Skip to content

Instantly share code, notes, and snippets.

@colinjfw
Created February 24, 2019 04:36
Show Gist options
  • Save colinjfw/4926cd611b498e4b85fad788f28e423e to your computer and use it in GitHub Desktop.
Save colinjfw/4926cd611b498e4b85fad788f28e423e to your computer and use it in GitHub Desktop.
const express = require('express');
const app = express();
function start() {
return { color: "#3d00a6" }
}
function move(state) {
console.log(state);
return { move: 'right' }
}
app.post('/start', (req, res) => { res.json(move()) });
app.post('/move', (req, res) => { res.json(move()) });
app.post('/end', (req, res) => { res.json({}) });
app.post('/ping', (req, res) => { res.json({}) });
app.listen(3000, () => {
console.log("Listening on port 3000");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment