d-pac / restful-keystone

Automatic RESTful API enabler for KeystoneJS
MIT License
160 stars 50 forks source link

GET /api/users 404 #7

Open sgireddy opened 9 years ago

sgireddy commented 9 years ago

I have been getting 404 errors when using it with keystone 3.0 (used 3.10 first then downgraded to 3.0 still the problem persists), appreciate any help.

package.json

   "keystone": "^0.3.0",
    "restful-keystone": "^0.3.0",
//routes/index.js
var keystone = require('keystone'),
    middleware = require('./middleware'),
    importRoutes = keystone.importer(__dirname);
var restful = require('restful-keystone')(keystone);
keystone.pre('routes', middleware.initLocals);
keystone.pre('render', middleware.flashMessages);
var routes = {
    views: importRoutes('./views')
};
exports = module.exports = function(app) {   
    restful.expose({
        User : true
    }).start(); 
};
creynders commented 9 years ago

Hi there, I should have some time this week to look into this and help you out. I'll keep you updated.

manuelnelson commented 9 years ago

Hey sgireddy - my guess is you're using windows. I just came across this problem as well. See https://github.com/d-pac/restful-keystone/pull/5 for the fix (at least for windows users) .