Skip to content

Commit

Permalink
removed host variable and prettified syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
katjuell committed Feb 6, 2019
1 parent 8df9db9 commit aab3cf1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions app.js
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!')
})

0 comments on commit aab3cf1

Please sign in to comment.