Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Cannot GET /public/staffRegister in node.js

var express = require("express");
var path = require("path");

var port = 2121;
var app = express();

// Register Middlewares/Headers
app.use((req, res, next) => {
  res.header("Access-Control-Allow-Origin", "*");
  next();
});

// Register Static
app.use("/public", express.static(__dirname + "/public"));

// Register redirect
app.get('/', (req, res) => {
  res.redirect(req.baseUrl + '/public/signup.html');
});


app.listen(port, () => {
  console.log("server Running on : ", port);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: triangle sum of odds numbers formula 
Javascript :: string in vue.js 
Javascript :: Spread Syntax for array literals or strings 
Javascript :: gsheet business days 
Javascript :: jquery elements to json 
Javascript :: path error 
Javascript :: javascript random function 
Javascript :: chrome extension sendmessage await until getdata 
Javascript :: add active class to button onclick react 
Javascript :: Remove all index from array except the one jquery 
Javascript :: get json model from another component in sapui5 
Javascript :: conditional json spread operator 
Javascript :: Scratch Addon userscript 
Javascript :: firebase iterate object 
Javascript :: Deputy json file 
Javascript :: how to change the backgroung of one button when click the other one 
Javascript :: AjaxGet 
Javascript :: does mysql accept json 
Javascript :: javascript YUP utilisation to math certain disire in forms 
Javascript :: enzym.debug 
Javascript :: send back text from get request in node.js 
Javascript :: how to get the index of an object inside of a map js 
Javascript :: what is runtime in javascript 
Javascript :: clear input field javascript 
Javascript :: asp.net mvc with ext js 
Javascript :: Perform native operation by javascript in Android 
Javascript :: como gerar numeros aleatorios em javascript a partir de uma função 
Javascript :: how to make a tampermonkey script for all pages 
Javascript :: blockchain.info/pushtx 
Javascript :: how to difference of arrey object 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =