Browse Source

Use Node.js 7 native async/await instead of babel

master
Menci 8 years ago
parent
commit
6ff3e571e7
  1. 4
      app.js
  2. 4
      package.json

4
app.js

@ -109,13 +109,11 @@ global.syzoj = {
}).catch((err) => { }).catch((err) => {
this.log(err); this.log(err);
res.locals.user = req.session.user_id = null; res.locals.user = req.session.user_id = null;
}).finally(() => {
next();
}) })
} else { } else {
res.locals.user = req.session.user_id = null; res.locals.user = req.session.user_id = null;
next();
} }
next();
}); });
// Active item on navigator bar // Active item on navigator bar

4
package.json

@ -4,7 +4,7 @@
"description": "An OnlineJudge System for OI", "description": "An OnlineJudge System for OI",
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"start": "babel-node app.js", "start": "node --harmony-async-await app.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"repository": { "repository": {
@ -25,8 +25,6 @@
"dependencies": { "dependencies": {
"adm-zip": "^0.4.7", "adm-zip": "^0.4.7",
"ansi-to-html": "^0.4.2", "ansi-to-html": "^0.4.2",
"babel-cli": "^6.18.0",
"babel-preset-es2017": "^6.16.0",
"body-parser": "^1.15.2", "body-parser": "^1.15.2",
"cookie-parser": "^1.4.3", "cookie-parser": "^1.4.3",
"ejs": "^2.5.2", "ejs": "^2.5.2",

Loading…
Cancel
Save