Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

simple express server responce html css js

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

const httpPort = 80

const app = express()

app.use(express.static(path.join(__dirname, 'public')))

app.get('/', function(req, res) {
  res.sendFile(path.join(__dirname, 'public/index.html'))
})

app.listen(httpPort, function () {
  console.log(`Listening on port ${httpPort}!`)
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: Backbone Notes Miscellaneous 
Javascript :: Deployment of react static page using node and express 
Javascript :: wait untill 2 
Javascript :: miragejs url parameters 
Javascript :: recursive function and json object 
Javascript :: how to get on hnage input before clicking off 
Javascript :: how to write code for browser back button in javascript 
Javascript :: Backbone Sync And Fetch 
Javascript :: iconbuttons onclick redirect to another page on react 
Javascript :: discord.js profile picture 
Javascript :: react custum toogle 
Javascript :: nested object in javascript 
Javascript :: javascript tree search 
Javascript :: parse json 
Javascript :: convert jquery to javascript converter online tool 
Javascript :: javascript oop 
Javascript :: javascript alarm 
Javascript :: Access to localhost from other machine - Angular 
Javascript :: generate a link with javascript 
Javascript :: moment js get last week start and end date 
Javascript :: createReadStream axios 
Javascript :: How to print even and odd position characters of an array of strings in JavaScript 
Javascript :: array of numbers to array of objects 
Javascript :: javascript Inside a regular function 
Javascript :: javascript Duplicating a parameter name is not allowed 
Javascript :: !Object.construct polyfill 
Javascript :: javascript get days difference between two dates 
Javascript :: how to get html element coords in js 
Javascript :: phaser rotate around distance 
Javascript :: test unitaire javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =