diff --git a/app.js b/app.js index 3cff1ca..29f7b4f 100644 --- a/app.js +++ b/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) { diff --git a/public/scripts/submit.js b/public/scripts/submit.js new file mode 100644 index 0000000..e69de29 diff --git a/routes/data.js b/routes/data.js new file mode 100644 index 0000000..05f5291 --- /dev/null +++ b/routes/data.js @@ -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; \ No newline at end of file diff --git a/views/layout.pug b/views/layout.pug index 69f5a59..e4f85eb 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -7,3 +7,4 @@ html block stylesheets body block content + block scripts diff --git a/views/submit.pug b/views/submit.pug index 385ad51..149fde7 100644 --- a/views/submit.pug +++ b/views/submit.pug @@ -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') \ No newline at end of file