“Express melayani html” Kode Jawaban

Express melayani 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 Public

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

Ekspres JS melayani 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

Jawaban yang mirip dengan “Express melayani html”

Pertanyaan yang mirip dengan “Express melayani html”

Lebih banyak jawaban terkait untuk “Express melayani html” di HTML

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya