Angular 2 RC with express server instead of lite server

╄→尐↘猪︶ㄣ 提交于 2020-01-23 18:29:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!