Skip to content

Instantly share code, notes, and snippets.

@AWolf81
Created December 18, 2018 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AWolf81/73608dfa69e4abb59a9e1bda79c8a2c4 to your computer and use it in GitHub Desktop.
Save AWolf81/73608dfa69e4abb59a9e1bda79c8a2c4 to your computer and use it in GitHub Desktop.
Basic Express server example
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!'));
{
"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