move API routes into api subdir

This commit is contained in:
azivner
2017-10-15 17:09:41 -04:00
parent 597a9063e5
commit e8655a84e2
9 changed files with 32 additions and 32 deletions

View File

@@ -0,0 +1,14 @@
const express = require('express');
const router = express.Router();
const sql = require('../../sql');
const auth = require('../../auth');
router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => {
const noteId = req.params.noteId;
const history = await sql.getResults("select * from notes_history where note_id = ? order by date_modified desc", [noteId]);
res.send(history);
});
module.exports = router;