Tag: 其余的是

使用nodejs创buildREST API以用于contentBlocks(createjs.org)

我在这里的问题是非常具体的,但如何设置一个REST查找调用与contentBlocks的NodeJS插件( https://github.com/primaryobjects/contentblocks )使用挣扎。 我的contentBlockpath设置如下: var contentBlocks = require('contentblocks')( { app: app, host: 'localhost', pathFind: '/content/find?q={"@subject":"[id]"}', pathPost: '/content', pathPut: '/content/[id]', pathDelete: '/content/[id]' }); 我的路线设置为: router.get('/content/find?q={"@subject":"[id]"}', content.find); 哪个映射到content.js: exports.find = function(req, res) { res.json("[]"); } 当我执行的时候,当页面被访问时,我不断收到以下错误: GET /content/find?q={"@subject":"<homePage_description>"} 404 275.193 ms – 3986 undefined:1 <!DOCTYPE html><html><head><title></title><link rel="stylesheet" href="/styles ^ SyntaxError: Unexpected token < at Object.parse (native) at […]