зеркало из https://github.com/mozilla/galaxy-api.git
fix regressed URL routes, and move `server.routes` call (from #360)
This commit is contained in:
Родитель
62989c3d64
Коммит
192837fd74
|
@ -4,15 +4,13 @@ var Game = require('./controllers/game');
|
|||
var User = require('./controllers/user');
|
||||
|
||||
|
||||
module.exports = function (server) {
|
||||
module.exports = [
|
||||
|
||||
var route = server.route;
|
||||
{method: 'GET', path: '/games', config: Game.all},
|
||||
{method: 'POST', path: '/games', config: Game.create},
|
||||
{method: 'GET', path: '/games/{idOrSlug}', config: Game.get},
|
||||
{method: 'DELETE', path: '/games/{idOrSlug}', config: Game.remove},
|
||||
{method: 'PUT', path: '/games/{idOrSlug}', config: Game.update},
|
||||
|
||||
route({method: 'GET', path: '/games', config: Game.all});
|
||||
route({method: 'POST', path: '/games', config: Game.create});
|
||||
route({method: 'GET', path: '/games/{idOrSlug}', config: Game.get});
|
||||
route({method: 'DELETE', path: '/games/{idOrSlug}', config: Game.remove});
|
||||
route({method: 'PUT', path: '/games/{idOrSlug}', config: Game.update});
|
||||
|
||||
route({method: 'POST', path: '/user/login', config: User.login});
|
||||
};
|
||||
{method: 'POST', path: '/user/login', config: User.login}
|
||||
];
|
||||
|
|
2
index.js
2
index.js
|
@ -22,7 +22,7 @@ server.connection({
|
|||
}
|
||||
});
|
||||
|
||||
routes(server);
|
||||
server.route(routes);
|
||||
|
||||
// Do not start the server when this script is required by another script.
|
||||
if (!module.parent) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче