Skip to content

Instantly share code, notes, and snippets.

@andijakl
Last active October 11, 2018 09:58
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 andijakl/1fab6372fab9a6ebfc1e35e93587b860 to your computer and use it in GitHub Desktop.
Save andijakl/1fab6372fab9a6ebfc1e35e93587b860 to your computer and use it in GitHub Desktop.
Start template for Express web server in Node.js
// Import the "express" module for more powerful web server capabilities.
const express = require('express');
// Initialize the express module and make it accessible via the app variable.
const app = express()
app.get('/', async (req, res) => {
// We'll write all our code here. For now, to test
res.end("Hello DB!");
});
// Start the server, listen at port 3000 (-> http://127.0.0.1:3000/)
// Also print a short info message to the console (visible in
// the terminal window where you started the node server).
app.listen(3000, () => console.log('Example app listening on port 3000!'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment