generated from corysanin/nodejs-web-template
fix build
This commit is contained in:
18
src/Web.ts
18
src/Web.ts
@@ -1,8 +1,6 @@
|
||||
import * as http from "http";
|
||||
import crypto from 'crypto';
|
||||
import express from 'express';
|
||||
import session from 'express-session';
|
||||
import ky from 'ky';
|
||||
import bodyParser from 'body-parser';
|
||||
import type { Express } from 'express';
|
||||
|
||||
@@ -44,18 +42,6 @@ class Web {
|
||||
app.set('view engine', 'ejs');
|
||||
app.set('view options', { outputFunctionName: 'echo' });
|
||||
app.use('/assets', express.static('assets', { maxAge: '30 days' }));
|
||||
app.use(session({
|
||||
name: 'sessionId',
|
||||
secret: sessionSecret,
|
||||
resave: true,
|
||||
saveUninitialized: false,
|
||||
store: undefined,
|
||||
cookie: {
|
||||
maxAge: notStupidParseInt(process.env['COOKIETTL']) || 1000 * 60 * 60 * 24 * 30, // 30 days
|
||||
httpOnly: true,
|
||||
secure: !!options.secure
|
||||
}
|
||||
}));
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
app.use((_req, res, next) => {
|
||||
@@ -84,10 +70,6 @@ class Web {
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/ky', async (_, res) => {
|
||||
res.send(await (await ky.get('https://sanin.dev')).text());
|
||||
});
|
||||
|
||||
this._webserver = this.app.listen(this.port, () => console.log(`archery is running on port ${this.port}`));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user