1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
Ambrose Chua 19eae703f4 style: Format code 2022-02-16 19:33:13 +08:00
Ambrose Chua 52b6fa5b91 fix: Bump ws and nodemon 2022-02-16 19:31:38 +08:00
4 changed files with 2136 additions and 45 deletions

View File

@ -1,31 +1,32 @@
const assets = [ const assets = [
{ {
path: 'bootstrap', path: "bootstrap",
modulePath: 'bootstrap/dist', modulePath: "bootstrap/dist",
}, },
{ {
path: 'jquery', path: "jquery",
modulePath: 'jquery/dist', modulePath: "jquery/dist",
}, },
{ {
path: 'octicons', path: "octicons",
modulePath: '@primer/octicons/build', modulePath: "@primer/octicons/build",
}, },
{ {
path: 'filesize', path: "filesize",
modulePath: 'filesize/lib', modulePath: "filesize/lib",
}, { },
path: 'xterm', {
modulePath: 'xterm', path: "xterm",
}, { modulePath: "xterm",
path: 'xterm-addon-attach', },
modulePath: 'xterm-addon-attach', {
}, { path: "xterm-addon-attach",
path: 'xterm-addon-fit', modulePath: "xterm-addon-attach",
modulePath: 'xterm-addon-fit', },
} {
path: "xterm-addon-fit",
modulePath: "xterm-addon-fit",
},
]; ];
module.exports = assets; module.exports = assets;

View File

@ -73,26 +73,28 @@ app.set("view engine", "handlebars");
app.use("/@assets", express.static(path.join(__dirname, "assets"))); app.use("/@assets", express.static(path.join(__dirname, "assets")));
// init assets // init assets
assets.forEach(asset => { assets.forEach((asset) => {
const { path: url, modulePath } = asset; const { path: url, modulePath } = asset;
app.use( app.use(
`/@assets/${url}`, `/@assets/${url}`,
express.static(path.join(__dirname, `node_modules/${modulePath}`)) express.static(path.join(__dirname, `node_modules/${modulePath}`))
); );
}) });
app.use( app.use(
session({ session({
secret: process.env.SESSION_KEY || "meowmeow", secret: process.env.SESSION_KEY || "meowmeow",
resave: false, resave: false,
saveUninitialized: false saveUninitialized: false,
}) })
); );
app.use(flash()); app.use(flash());
app.use(busboy()); app.use(busboy());
app.use(express.urlencoded({ app.use(
extended: false express.urlencoded({
})); extended: false,
})
);
// AUTH // AUTH
const KEY = process.env.KEY const KEY = process.env.KEY
@ -385,7 +387,7 @@ app.get("/*@download", (req, res) => {
let files = null; let files = null;
try { try {
files = JSON.parse(req.query.files); files = JSON.parse(req.query.files);
} catch (e) { } } catch (e) {}
if (!files || !files.map) { if (!files || !files.map) {
req.flash("error", "No files selected."); req.flash("error", "No files selected.");
res.redirect("back"); res.redirect("back");

2104
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,13 +25,13 @@
"notp": "^2.0.3", "notp": "^2.0.3",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"thirty-two": "^1.0.2", "thirty-two": "^1.0.2",
"ws": "^8.2.3", "ws": "^8.5.0",
"xterm": "^4.15.0", "xterm": "^4.15.0",
"xterm-addon-attach": "^0.6.0", "xterm-addon-attach": "^0.6.0",
"xterm-addon-fit": "^0.5.0" "xterm-addon-fit": "^0.5.0"
}, },
"devDependencies": { "devDependencies": {
"prettier": "^2.4.1", "nodemon": "^2.0.15",
"nodemon": "^1.18.4" "prettier": "^2.4.1"
} }
} }