Start template for Express web server in Node.js
This file contains 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
// 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