-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.mjs
27 lines (22 loc) · 787 Bytes
/
app.mjs
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
import express from 'express';
import fileUpload from 'express-fileupload';
import path from 'path';
import cookieParser from 'cookie-parser';
import logger from 'morgan';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
import indexRouter from './routes/index.mjs';
import bashRouter from './routes/bash.mjs';
import seriesRouter from './routes/series.mjs';
const app = express();
const __dirname = dirname(fileURLToPath(import.meta.url));
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(fileUpload());
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'client/build')));
app.use('/', indexRouter);
app.use('/bash', bashRouter);
app.use('/series', seriesRouter);
export default app;