【问题标题】:How to properly enable restful-keystone endpoint for model如何为模型正确启用 restful-keystone 端点
【发布时间】:2017-02-17 22:30:43
【问题描述】:

假设我有一个名为“Project”的模型,restful-keystone 的文档建议为它启用 API 端点应该像下面这样简单。

exports = module.exports = function(app) {
    app.get('/', routes.views.index);
    app.get('/gallery', routes.views.gallery);

    restful.expose({
        Project: true
    }).start();
};

但是,当我启动 keystone 时,我得到以下信息:

Rest is not enabled for galleries
Rest is not enabled for projects
Rest is not enabled for users

谁能向我解释发生了什么以及如何让它发挥作用?

【问题讨论】:

    标签: keystonejs


    【解决方案1】:

    经过一番研究,找到了解决方案:

    https://github.com/d-pac/restful-keystone/pull/5

    这个问题只发生在 Windows 上,因为 url 使用 path.join()。

    使用此https://github.com/d-pac/restful-keystone/pull/5/commits/0d8cf0c1514bad810fbc2345114d913cfb1e921a 补丁暂时解决您的问题。

    很遗憾维护者还没有合并拉取请求。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-11
      • 2015-05-24
      • 1970-01-01
      • 2022-11-24
      • 1970-01-01
      • 1970-01-01
      • 2017-07-26
      • 1970-01-01
      相关资源
      最近更新 更多