Created
May 5, 2019 17:03
-
-
Save thedamian/bd69c8bae23328795082b88a580cbf94 to your computer and use it in GitHub Desktop.
basic node express app
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
const http = require("http"); | |
const express = require("express"); | |
const app = express(); | |
app.set('view engine', 'ejs'); | |
const port = 5000; ; | |
app.get("/",(req,res)=> { | |
res.end("Hello world"); | |
}); | |
app.use(express.static(__dirname + "/")); | |
var server = http.createServer(app); | |
server.listen(port); // Point it to the port we defined above. | |
console.log("ready at port " +port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment