Skip to content

Instantly share code, notes, and snippets.

@alex3165
Last active March 4, 2020 09:20
Show Gist options
  • Save alex3165/20ed1d5e893e19fa61dc2f03e97e837b to your computer and use it in GitHub Desktop.
Save alex3165/20ed1d5e893e19fa61dc2f03e97e837b to your computer and use it in GitHub Desktop.
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express();
// Send CORS Headers, useful if API is requested from a browser
app.use(cors());
// Parse request body to json
app.use(bodyParser.json());
app.get('/', (req, res) => {
res.send({ message: 'healthy' })
});
app.listen(3000, () => console.log('Gator app listening on port 3000!'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment