Last active
December 19, 2015 07:08
-
-
Save j127/5916057 to your computer and use it in GitHub Desktop.
Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app.js | |
var express = require('express') | |
, routes = require('./routes') | |
, user = require('./routes/user') | |
, http = require('http') | |
, path = require('path') | |
// Include another file | |
, score = require('./routes/score'); | |
app.get('/', routes.index); | |
// Use the function from /routes/score.js | |
app.post('/', score.addScore); | |
// Then in /routes/score.js, make the function | |
exports.addScore = function(req, res) { | |
var score = req.body; | |
console.log("Received: " + score); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment