Monday 20 February 2017

cant connect css to html using express/pug

I've tried for hours trying to figure out what I'm doing wrong. I've copied someone else's code almost exactly to no avail.var express = require('express'); var app = express(); var path = require('path'); var routes = require('./routes') app.set('views', path.join(__dirname, 'views')); app.use(express.static(path.join(__dirname, 'public'))); app.set('view engine', 'pug'); app.get('/', function(req, res){ res.render(__dirname + '/views/index.pug') }); app.listen(8888, function(req, res){ console.log('server is listening on port 8888'); }); pug file:doctype html html head link(href='../public/stylesheets/style.css' rel='stylesheet') title body p this is a para .red folder structure: sockettest app.js views index.pug public stylesheets style.css

Submitted February 20, 2017 at 06:48PM by Chigurhshairdresser

No comments:

Post a Comment