25 lines
512 B
JavaScript
Executable File
25 lines
512 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
var express = require('express');
|
|
var keywords = require('./db/keywords.json');
|
|
var data = require('./db/data.json');
|
|
var _ = require('underscore');
|
|
|
|
function main() {
|
|
var app = express();
|
|
var router = express.Router();
|
|
|
|
router.use('/keywords', function(req, res, next) {
|
|
console.log('Requesting keywords');
|
|
res.json(_.keys(keywords));
|
|
});
|
|
|
|
app.use('/hscd', router);
|
|
app.listen(3000);
|
|
}
|
|
|
|
if (require.main === module) {
|
|
main();
|
|
}
|
|
|