youtube-maze/app.mjs

21 lines
565 B
JavaScript
Raw Normal View History

2020-11-28 17:07:04 +00:00
import express from 'express';
2020-11-29 01:12:59 +00:00
import helmet from 'helmet';
2020-11-28 17:07:04 +00:00
import path from 'path';
import cookieParser from 'cookie-parser';
import logger from 'morgan';
import { fileURLToPath } from 'url';
const thisdir = path.dirname(fileURLToPath(import.meta.url));
const app = express();
export default app;
2020-11-29 01:12:59 +00:00
app.use(helmet());
2020-11-28 17:07:04 +00:00
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(thisdir, 'public')));
import mazes from './routes/mazes.mjs';
app.use('/mazes', mazes);