简体   繁体   中英

API For REST Request From NodeJS to Backend

我有一个应用程序,其中angular将数据发送到nodejs,然后nodejs将数据发送到在Jetty中运行的后端,谁能建议将REST请求从NodeJ发送到后端的最佳API /方法是什么?

You probably don't want to sister your jetty api in node (endpoint for endpoint). You probably want to handle all requests that match a certain path, say /api and then pass those on to jetty. That is, if you can. Maybe the jetty api is not to be directly exposed.

Either way you should use the most excellent request library to call jetty from your node endpoints:

https://github.com/request/request

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM