21 lines
565 B
JavaScript
21 lines
565 B
JavaScript
import express from 'express';
|
|
import helmet from 'helmet';
|
|
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;
|
|
|
|
app.use(helmet());
|
|
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);
|