“Express Serve html” Code-Antworten

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 öffentlich

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

Express JS dienen 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

Ähnliche Antworten wie “Express Serve html”

Fragen ähnlich wie “Express Serve html”

Weitere verwandte Antworten zu “Express Serve html” auf HTML

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen