1
是否有任何好的示例或指導,任何人都可以提供構建這樣的應用程序?node.js angular jade客戶端和node.js rest api
Client (client.company.com)
Node.js
Angular
Jade
ExpressJS
Server (private) (server.company.com)
node.js
"rest" api (express)
該API現在是私有的,只能從託管服務器訪問。
如果有一個頁面創建食譜例如,是這樣嗎? 客戶端
- angular form with router that posts to client.company.com/recipe
- express would need route to handle that /recipe
- that route would then post to api server server.company.com/recipe
- then response would be propagated through the layers back to the ui.
那是不是有客戶端複製api路由?有什麼可以做的,以簡化和減少重複的東西?
感謝您的回答。我們還沒有準備好這麼做,因爲api上沒有任何安全措施可以讓任何人使用它。 – dre 2013-05-07 23:29:54
好了,那你上面說的是在正確的軌道上,除了你可以通過在api服務器上快速設置通配符路由來節省時間。如果需要身份驗證,則可以在express上截取請求,並在轉發到api服務器之前將必要的身份驗證令牌/等附加到http標頭/ url。 – maethorr 2013-05-08 08:43:27