Skip to content

Commit

Permalink
[Task] #18 prevent parameter pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
Type-Style committed Jan 19, 2024
1 parent 2145888 commit 3c5a6a2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/express": "^4.17.21",
"@types/hpp": "^0.2.5",
"@types/node": "^20.10.6",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
Expand All @@ -28,6 +29,7 @@
"dependencies": {
"express": "^4.18.2",
"express-validator": "^7.0.1",
"hpp": "^0.2.3",
"module-alias": "^2.2.3"
},
"_moduleAliases": {
Expand Down
4 changes: 3 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
require('module-alias/register');
import { config } from 'dotenv';
import express from 'express';
import hpp from 'hpp';
import fs from 'fs';
import path from 'path';
import writeRouter from '@src/controller/write';

// configurations
config();
const app = express();
app.use(hpp());

// routes
app.get('/', (req, res) => {
Expand All @@ -15,7 +18,6 @@ app.get('/', (req, res) => {

app.use('/write', writeRouter);


// use httpdocs as static folder
app.use('/', express.static(path.join(__dirname, 'httpdocs')))

Expand Down

0 comments on commit 3c5a6a2

Please sign in to comment.