Skip to content

Instantly share code, notes, and snippets.

@syuji-higa
Created October 7, 2020 07:46
Show Gist options
  • Save syuji-higa/2848a23de1e880954303619b124131e0 to your computer and use it in GitHub Desktop.
Save syuji-higa/2848a23de1e880954303619b124131e0 to your computer and use it in GitHub Desktop.
Node.js - local server
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