Created
July 2, 2018 14:50
-
-
Save bmorelli25/29f99aafdb8ead88778d3862d61fd9cc to your computer and use it in GitHub Desktop.
Realtime Paint Application - server
This file contains hidden or 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
| // 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