forked from katjuell/nodejs-image-demo
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed host variable and prettified syntax
- Loading branch information
Showing
1 changed file
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
const express = require("express"); | ||
const express = require('express'); | ||
const app = express(); | ||
const router = express.Router(); | ||
|
||
const path = __dirname + '/views/'; | ||
|
||
const PORT = 8080; | ||
const HOST = '0.0.0.0'; | ||
const port = 8080; | ||
|
||
router.use(function (req,res,next) { | ||
console.log("/" + req.method); | ||
console.log('/' + req.method); | ||
next(); | ||
}); | ||
|
||
router.get("/",function(req,res){ | ||
res.sendFile(path + "index.html"); | ||
router.get('/',function(req,res){ | ||
res.sendFile(path + 'index.html'); | ||
}); | ||
|
||
router.get("/sharks",function(req,res){ | ||
res.sendFile(path + "sharks.html"); | ||
router.get('/sharks',function(req,res){ | ||
res.sendFile(path + 'sharks.html'); | ||
}); | ||
|
||
app.use(express.static(path)); | ||
app.use("/", router); | ||
app.use('/', router); | ||
|
||
app.listen(8080, function () { | ||
app.listen(port, function () { | ||
console.log('Example app listening on port 8080!') | ||
}) |