Closed Zelbinian closed 9 years ago
I figured it out by playing with the routing-app files to see why that app was loading but this one wasn't. Turns out, when I was moving all the stuff from server.js to api.js, this line accidentally got deleted:
app.use(express.static(__dirname + '/public'));
Had no idea that line was so important!
Took me a while to track down the source of this issue, but now that I have I don't know how to continue with the rest of the book.
In the server.js file, as it's constructed in previous chapters, we're instructed to write this catchall route for front-end routing just before we start the app listening:
And in the index.html file, we're instructed to call our angular services, controllers, and app files thusly:
Because of the catchall route node intercepts these requests and sends back index.html, like we told it to. But we need that catchall route in there to forward requests to the frontend so... what to do isn't clear.
But I could also be missing something.