Skip to content
Snippets Groups Projects
Commit 9a25381d authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Basic prototype

Not following any specs
parent bcfdbac0
No related branches found
No related tags found
No related merge requests found
# Node+Express base
This project contains necessary files and code to start a NodeJS+Express server.
## License
This project is under the [MIT License](LICENSE).
# SIMCAQ
......@@ -18,7 +18,7 @@ app.use(bodyParser.urlencoded({ extended: false }))
app.use(cookieParser())
app.use(methodOverride())
app.use('/v1/', api)
app.use('/api/v1/', api)
// catch 404 and forward to error handler
app.use(function(req, res, next){
......
......@@ -14,4 +14,27 @@ router.get('/', function (req, res) {
})
})
router.get('/data', function(req, res) {
console.log(req.query)
console.log(req.query.met)
console.log(req.query.dim)
conn.query(
'SELECT * FROM turmas'
).then(function(result) {
res.json({
result: result
})
})
})
router.get('/matriculas', function(req, res) {
conn.query(
'SELECT count(VT07) FROM turmas WHERE VT11 <= 3'
).then(function(result) {
res.json({
result: result
})
})
})
module.exports = router
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment