JetB Coder
JetB Coder

Reputation: 1

Trying to create a node server that refreshes with file changes , html, js or css

So I have a basic express app and I'm trying to have it refresh with file changes , I've tried reload, supervisor, nodemon and browser-refresh with no luck , any tips.

Here's my app.js

const path = require('path')
const express = require('express')

let app = express()
let port = process.env.PORT || 3000

app.get('/', function (req, res) {
res.sendFile(path.resolve('index.html'))
})

app.listen(port,function(){
console.log("magic happens on port " + port)
})

and then I run

nodemon or supervisor or browser-refresh app.js

Upvotes: 0

Views: 51

Answers (0)

Related Questions