Created
December 18, 2018 14:23
-
-
Save AWolf81/73608dfa69e4abb59a9e1bda79c8a2c4 to your computer and use it in GitHub Desktop.
Basic Express server example
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
const express = require('express'); | |
const app = express(); | |
app.get('/', (req, res) => { | |
res.send('An alligator approaches!'); | |
}); | |
app.listen(3000, () => console.log('Gator app listening on port 3000!')); |
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
{ | |
"name": "basic_server", | |
"version": "1.0.0", | |
"main": "app.js", | |
"license": "MIT", | |
"scripts": { | |
"start": "node ./app.js" | |
}, | |
"dependencies": { | |
"express": "^4.16.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment