JWT Autorization / Logging in and registering

This commit is contained in:
2020-07-19 14:35:51 +02:00
parent a267dd1f37
commit 9f4f5347d4
279 changed files with 23396 additions and 33 deletions

View File

@@ -15,11 +15,14 @@ export default ({ app, secret }) => {
max: 100, //requests from a single IP for a time window
});
app.use(bodyParser.json({ limit: "100kb" })); // limit JSON body payload size
app.use(bodyParser.urlencoded({ extended: true }));
app.use(helmet());
app.use(limiter);
app.use(cors());
app.use(bodyParser.json({ limit: "100kb" })); // limit JSON body payload size
app.use(bodyParser.urlencoded({ extended: true }));
app.use(function (err, req, res, next) {
if (err) res.sendStatus(422);
});
app.use(cookieParser(secret));
app.use("/dish", routeDish);
app.use("/city", routeCity);