How's it going? I've been experimenting with middleware in Express JS, like this:
app.get ('/user/:school/:dual', function (req, res, next) {
......
...
......
});
Everything seems to be working fine so far.
But when I navigate to a specific route, such as:
For instance localhost:4000/UCLA/2019
The defined styles aren't showing up.
I'm utilizing static files in Express JS within the public folder:
var express = require ('express');
var app = express ();
var path = require ('path');
//app.use(express.static(__dirname)); // Current directory is root
app.use (express.static (path.join (__ dirname, 'public'))); // "public" off of current is root
app.listen (4000);
console.log ('Listening on port 4000');
The Public folder contains the following subfolders:
* Images
-school
-Light
* Vendor
* Bootstrap
* dist
* css
-file1.css
-file2.css
* fonts
* js
I attempted removing some of the folders to speed up access to static files, but even after doing so, when trying to access localhost:4000/UCLA/2019, the CSS styles don't load properly.