Created
February 15, 2016 01:22
-
-
Save etsuo/28f6e33612fe08210f62 to your computer and use it in GitHub Desktop.
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
| var express = require('express'), | |
| app = express(), | |
| bodyParser = require('body-parser'); | |
| app.use(bodyParser.urlencoded({extended: true})); | |
| app.use(bodyParser.json()); | |
| var port = process.env.PORT || 7070; | |
| var router = express.Router(); | |
| app.all('*', function (req, res, next) { | |
| res.header("Access-Control-Allow-Origin", "*"); | |
| res.header("Access-Control-Allow-Headers", "X-Requested-With"); | |
| res.header("Access-Control-Allow-Headers", "Content-Type"); | |
| next(); | |
| }); | |
| router.post('/auth/oauth', oAuth); | |
| app.use('/api', router); | |
| app.listen(port); | |
| console.log('Test Server Listening ' + port); | |
| ////////// | |
| function oAuth(req, res) { | |
| res.json({user: 'exists'}); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment