Last active
February 13, 2018 17:23
-
-
Save pchinjr/dbb37c2bba58d3b74c43b9503fc8cee2 to your computer and use it in GitHub Desktop.
expressjs example
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 express = require('express'); | |
const app = express(); | |
const server = require("http").createServer(app); | |
const port = 3000; | |
server.listen(port); | |
console.log(`Server listening at http://localhost: ${port}`); | |
app.use(express.static(__dirname + '/public')); | |
app.get('/', (req, res) => res.sendFile(__dirname + '/public/index.html')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment