-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (23 loc) · 729 Bytes
/
Copy pathindex.js
File metadata and controls
26 lines (23 loc) · 729 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
const express = require('express')
const morgan = require('morgan')
const path = require('path')
const fs = require('fs')
const helmet = require('helmet')
const cors = require('cors');
const app = express()
const fromUrlRouter = require('./routes/fromUrlRouter')
const fromHtmlRouter = require('./routes/fromHtmlRouter')
var accessLogStream = fs.createWriteStream(
path.join(__dirname, "server.log"),
{
flags: "a"
}
);
app.use(cors());
app.use(morgan("combined", { stream: accessLogStream }));
app.use(helmet());
app.use(express.urlencoded({ extended: true, limit: '100mb' }));
app.use(express.json({ limit: '100mb' }))
app.use('/url', fromUrlRouter);
app.use('/html', fromHtmlRouter);
module.exports = app