Answers for "serve a file in express"

0

serve a file in express

const express = require('express')
const app = express()

app.use(express.static(__dirname + '/dist'))

app.get('/', (_, res) => {
    res.sendFile('index.html')
})

app.listen(3000)
Posted by: Guest on June-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language