Skip to content

Instantly share code, notes, and snippets.

@seoh
Created July 18, 2021 14:55
Show Gist options
  • Save seoh/cea4fd5964d08579476dfb5212a042e5 to your computer and use it in GitHub Desktop.
Save seoh/cea4fd5964d08579476dfb5212a042e5 to your computer and use it in GitHub Desktop.
simple server with watching but without tool
const { createServer: server } = require('http')
server((req, res) => {
delete require.cache[require.resolve('./run.js')]
require('./run.js')(req, res)
}).listen(8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment