-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (28 loc) · 1.08 KB
/
app.js
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
32
33
34
35
const express = require('express');
let app = express();
// Middlewares
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const cors = require('cors')
const swaggerUi = require('swagger-ui-express');
const swaggerDocument = require('./swagger.json')
// Routers
const itemRouter = require('./routes/item-routes');
const categoryRouter = require('./routes/category-routes')
const donatersRouter = require('./routes/donater-routes')
const beneficiersRouter = require('./routes/beneficier-routes')
const donationformRouter = require('./routes/dform-routes')
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(cors());
app.use('/items', itemRouter);
app.use('/category', categoryRouter);
app.use('/donaters', donatersRouter);
app.use('/beneficiers', beneficiersRouter);
app.use('/donationform', donationformRouter);
//app.use('/admin', adminRoute)...eklenecek
app.use('/', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
app.listen(3000, ()=>{
console.log("listening on 3000"); });