问题
I would like to create single page application with latest angular 2 rc and express server.I don't know how to link both with out bower,gulp and webpack. There are some starter pack available but can't get the expected one.Please guide me
回答1:
The question is really broad but here's a github starter projects link with express and rc.1: Angular 2 starter project with express
The server identifies index.html from app.use( express.static(__dirname + '/client' ) );
line. This means look for a file that is named index.html under client directory.
You can add aditional routes for backend to routes.js. For client side, like navigating through the pages and stuff I suggest you to take a look at angular2's routing tutorial/documentation: http://angular.io/docs/ts/latest/tutorial/toh-pt5.html
来源:https://stackoverflow.com/questions/37559853/angular-2-rc-with-express-server-instead-of-lite-server