-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.js
More file actions
31 lines (23 loc) · 823 Bytes
/
app.js
File metadata and controls
31 lines (23 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import express from "express";
import morgan from "morgan";
import helmet from "helmet";
import bodyParser from "body-parser";
import cookieParser from "cookie-parser";
import foodRouter from "./Router/foodRouter";
import globalRouter from "./Router/globalRouter";
import routes from "./routes";
const app = express();
//app.engine('html', require('ejs').renderFile);
//app.set('view engine', 'html');
app.set("view engine", "ejs");
app.use(helmet());
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use(express.static(__dirname + '/assets'));
app.use(morgan("dev"));
app.locals.cdata = require('./assets/src/foods.json');
app.use(routes.home, globalRouter);
app.use(routes.foods, foodRouter);
app.use(routes.foodsearch,globalRouter);
export default app;