Skip to content

Commit

Permalink
style: Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
serverwentdown committed Feb 16, 2022
1 parent 52b6fa5 commit 19eae70
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 34 deletions.
55 changes: 28 additions & 27 deletions assets/index.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
const assets = [
{
path: 'bootstrap',
modulePath: 'bootstrap/dist',
},
{
path: 'jquery',
modulePath: 'jquery/dist',
},
{
path: 'octicons',
modulePath: '@primer/octicons/build',
},
{
path: 'filesize',
modulePath: 'filesize/lib',
}, {
path: 'xterm',
modulePath: 'xterm',
}, {
path: 'xterm-addon-attach',
modulePath: 'xterm-addon-attach',
}, {
path: 'xterm-addon-fit',
modulePath: 'xterm-addon-fit',
}
{
path: "bootstrap",
modulePath: "bootstrap/dist",
},
{
path: "jquery",
modulePath: "jquery/dist",
},
{
path: "octicons",
modulePath: "@primer/octicons/build",
},
{
path: "filesize",
modulePath: "filesize/lib",
},
{
path: "xterm",
modulePath: "xterm",
},
{
path: "xterm-addon-attach",
modulePath: "xterm-addon-attach",
},
{
path: "xterm-addon-fit",
modulePath: "xterm-addon-fit",
},
];


module.exports = assets;

16 changes: 9 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,28 @@ app.set("view engine", "handlebars");

app.use("/@assets", express.static(path.join(__dirname, "assets")));
// init assets
assets.forEach(asset => {
assets.forEach((asset) => {
const { path: url, modulePath } = asset;
app.use(
`/@assets/${url}`,
express.static(path.join(__dirname, `node_modules/${modulePath}`))
);
})
});

app.use(
session({
secret: process.env.SESSION_KEY || "meowmeow",
resave: false,
saveUninitialized: false
saveUninitialized: false,
})
);
app.use(flash());
app.use(busboy());
app.use(express.urlencoded({
extended: false
}));
app.use(
express.urlencoded({
extended: false,
})
);
// AUTH

const KEY = process.env.KEY
Expand Down Expand Up @@ -385,7 +387,7 @@ app.get("/*@download", (req, res) => {
let files = null;
try {
files = JSON.parse(req.query.files);
} catch (e) { }
} catch (e) {}
if (!files || !files.map) {
req.flash("error", "No files selected.");
res.redirect("back");
Expand Down

0 comments on commit 19eae70

Please sign in to comment.