Skip to content

Commit

Permalink
修复一些问题
Browse files Browse the repository at this point in the history
  • Loading branch information
benzhe committed Dec 13, 2016
1 parent 6c8111c commit b32e1fb
Show file tree
Hide file tree
Showing 4 changed files with 4,308 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ app.use(ssl());
app.use(serve('.'));

const records = JSON.parse(fs.readFileSync('records.json').toString());
router.get('/new_record/:record', function* (next) {
router.get('/new_record', function* (next) {
const record = this.query.record;
const now = (new Date()).toLocaleString();
records[now] = record;
fs.writeFileSync('records.json', JSON.stringify(records));
yield next;
this.body = record;
});
router.get('/api_rank', function* (next) {
this.body = JSON.stringify(records);
Expand Down
Loading

0 comments on commit b32e1fb

Please sign in to comment.