Search
 
SCRIPT & CODE EXAMPLE
 

HTML

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}!`)
})
Comment

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}!`)
})
Comment

PREVIOUS NEXT
Code Example
Html :: add frame to div 
Html :: am pm time html javascript 
Html :: how to convert input type file into an icon 
Html :: how to add a link in image 
Html :: Validate length with html 
Html :: javascript onclick back 
Html :: tailwind hover color 
Html :: html dns prefetch 
Html :: how to display an array in html 
Html :: html text box 
Html :: html favicon base64 
Html :: markdown: text alignment and size 
Html :: html beginform asp.net mvc add id 
Html :: predefine data list in input tag 
Html :: href phone number 
Html :: html text decoration 
Html :: safe webp image usage html 
Html :: javascript delay button 
Html :: multiple choice checkbox html 
Html :: open modal when clicking fullCalendar event bootstrap 
Html :: arnav.tcode.in 
Html :: sign up form html 
Html :: html radio label clickable 
Html :: thymeleaf input radio checked 
Html :: get directions google maps html 
Html :: 0 
Html :: install php windows 10 
Html :: working search bar html 
Html :: how to check if html table is empty using jquery 
Html :: javascript inline onclick get event 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =