Instantly share code, notes, and snippets.

@andijakl /index.js
Last active Oct 11, 2018

Embed
What would you like to do?
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