September 2017
Intermediate to advanced
450 pages
11h 24m
English
Express's concept of middleware allows you to control the order of operations performed on requests. Each piece of middleware is loaded into Express using the app.use command. When requests are received by Express, they are evaluated in a sequential order by the middleware. By defining our Angular route configuration before our API route configuration, we are setting up Express to handle those routes first.
In our /app.js we mounted our Angular route configuration to use the root route of our Express web server, which is simply denoted as '/':
app.use('/', angular);
This means that the root/ route will attempt to resolve static file paths on the root to the provided directory. It doesn't matter that the resources in question ...
Read now
Unlock full access