Umar Baig
Umar Baig

Reputation: 5

Node Express Server Cannot GET “/”

const https = require("http");
const app= require('./app');

const port =  8080;

const server = https.createServer(app);

server.listen(port)

Upvotes: 0

Views: 61

Answers (1)

gaaaaaa
gaaaaaa

Reputation: 366

I am not sure of what you were trying to do but you can use express in this way:

var express = require('express')
var app = express()

app.get('/', function (req, res) {
  /// do something here
})

app.listen(8080)

Also, check express guide : http://expressjs.com/en/starter/hello-world.html

Upvotes: 2

Related Questions