Skip to content

Instantly share code, notes, and snippets.

@bmorelli25
Created July 2, 2018 14:50
Show Gist options
  • Save bmorelli25/29f99aafdb8ead88778d3862d61fd9cc to your computer and use it in GitHub Desktop.
Save bmorelli25/29f99aafdb8ead88778d3862d61fd9cc to your computer and use it in GitHub Desktop.
Realtime Paint Application - server
// server.js
require('dotenv').config();
...
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
...
});
app.post('/paint', (req, res) => {
pusher.trigger('painting', 'draw', req.body);
res.json(req.body);
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment