Created
October 7, 2020 07:46
-
-
Save syuji-higa/2848a23de1e880954303619b124131e0 to your computer and use it in GitHub Desktop.
Node.js - local server
This file contains hidden or 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 { join } = require('path') | |
const express = require('express') | |
const app = express() | |
app.use(express.static(join(__dirname, 'docs'))) | |
const host = 'localhost' | |
const port = 3000 | |
app.listen(port, host, () => { | |
console.log('listening at http://%s:%s', host, port) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment