我应该如何运行Meteor的REST API?

我需要Meteor服务器来处理不是来自应用程序客户端的非常简单的POST请求。 快递,我只是做一些像app.post('/something', function...

meteor有没有相同的东西? 如果没有,我应该如何设置,在is_server上下文中启动一个Express服务器?

meteor还没有内置的function来提供一个宁静的API。

您可以使用Backbone在我们的应用程序中构build基本路由,如在此提供的Meteor示例中所示: http : //meteor.com/examples/todos

你可以做这样的事情:

 var AppRouter = Backbone.Router.extend({ routes: { "": "dashboard", "home": "dashboard", "profile": "profile", }, profile: function () { Session.set("current_view", "profile") this.navigate('profile', {trigger: true}); }, 

另请看看: 如何使用Meteor公开一个REST风格的Web服务

或者,您也可以使用meteor-collectionapi Atmosphere软件包为Meteor提供RESTful API。 如果我需要一个额外的REST API,请参阅meteor的选项吗? 。