“Express serve html” Respostas de código

Express serve html

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

const app = express()

const port = process.env.PORT || 3000
const publicDirectoryPath = path.join(__dirname, '../public')

app.use(express.static(publicDirectoryPath))

app.listen(port, () => {
    console.log(`Server is up on port ${port}!`)
})
Thor

App.Use público

app.use(express.static('public'))
app.use(express.static('files'))
Testy Tamarin

Express JS serve html

const express = require('express')

const app = express()
app.use(express.static('public'))

app.listen(port, () => {
    console.log(`Server is up on port ${port}!`)
})
SamuraiR4cc00n

Respostas semelhantes a “Express serve html”

Perguntas semelhantes a “Express serve html”

Mais respostas relacionadas para “Express serve html” em HTML

Procure respostas de código populares por idioma

Procurar outros idiomas de código