Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pqvst committed Mar 1, 2024
1 parent 7c0f7ba commit 610bba0
Show file tree
Hide file tree
Showing 4 changed files with 1,820 additions and 2,059 deletions.
18 changes: 3 additions & 15 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { I18n } from 'i18n';
import { Feed } from 'feed';
import { marked } from 'marked';
import * as viewHelpers from './view-helpers.js';
import * as data from './data.js';

let rollbar;
if (process.env.ROLLBAR_ACCESS_TOKEN) {
Expand Down Expand Up @@ -39,9 +40,6 @@ const i18n = new I18n({
},
});

import * as data from './data.js';
import * as submit from './submit.js';

const app = express();
const port = 3000;

Expand Down Expand Up @@ -206,22 +204,12 @@ const submissionLimiter = rateLimit({

app.get('/suggest', redirectWithTrailingSlash);
app.get('/suggest/', (req, res) => {
res.render('suggest');
res.redirect('/');
});

app.get('/submit', redirectWithTrailingSlash);
app.get('/submit/', (req, res) => {
res.redirect('/suggest/')
});

app.post('/submit/', submissionLimiter, async (req, res) => {
try {
await submit.submit(req.body);
res.send('ok');
} catch (err) {
console.log(err);
res.status(400).end();
}
res.redirect('/');
});

app.get('/feed.xml', (req, res) => {
Expand Down
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@
"license": "ISC",
"devDependencies": {
"ajv": "^8.12.0",
"linkinator": "^6.0.3",
"nodemon": "^3.0.2",
"linkinator": "^6.0.4",
"nodemon": "^3.1.0",
"shrinkem": "^2.1.0"
},
"dependencies": {
"express": "^4.17.1",
"express": "^4.18.3",
"express-rate-limit": "^7.1.5",
"feed": "^4.2.2",
"got": "^14.0.0",
"i18n": "^0.15.1",
"lodash": "^4.17.21",
"marked": "^11.1.1",
"marked": "^12.0.0",
"moment": "^2.30.1",
"moment-timezone": "^0.5.44",
"moment-timezone": "^0.5.45",
"morgan": "^1.10.0",
"pug": "^3.0.2",
"rollbar": "^2.26.2",
"yaml": "^2.3.4"
"rollbar": "^2.26.3",
"yaml": "^2.4.0"
},
"nodemonConfig": {
"ext": "js,md,json",
Expand Down
57 changes: 0 additions & 57 deletions submit.js

This file was deleted.

Loading

0 comments on commit 610bba0

Please sign in to comment.