Start script to fetch data from server
parent
78136df5fd
commit
8c3ffcc5fa
4
app.js
4
app.js
|
@ -6,7 +6,8 @@ var logger = require('morgan');
|
|||
|
||||
var indexRouter = require('./routes/index');
|
||||
var usersRouter = require('./routes/users');
|
||||
var submitRouter = require('./routes/submit')
|
||||
var submitRouter = require('./routes/submit');
|
||||
var dataRouter = require('./routes/data');
|
||||
|
||||
var app = express();
|
||||
|
||||
|
@ -23,6 +24,7 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|||
app.use('/', indexRouter);
|
||||
app.use('/users', usersRouter);
|
||||
app.use('/submit', submitRouter);
|
||||
app.use('/data', dataRouter);
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
app.use(function(req, res, next) {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
var express = require('express');
|
||||
var router = express.Router();
|
||||
var database = require('../database/database');
|
||||
|
||||
/* GET submit page. */
|
||||
router.get('/', function(req, res, next) {
|
||||
res.json( { message : "test" });
|
||||
});
|
||||
|
||||
module.exports = router;
|
|
@ -7,3 +7,4 @@ html
|
|||
block stylesheets
|
||||
body
|
||||
block content
|
||||
block scripts
|
||||
|
|
|
@ -39,3 +39,6 @@ block content
|
|||
input(class="score-input", type="number", name="team2-score", value="0")
|
||||
span(class='form-section')
|
||||
button(type="submit") Submit
|
||||
|
||||
block scripts
|
||||
script(src='/scripts/submit.js')
|
Reference in New Issue