Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] fix route order for now #6

Merged
merged 1 commit into from
Jul 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ export const Server = {
*/
registerRoutes(app: FabrixApp, server: Express) {
// Sort the routes so that they are always in the correct express order.
const routes = app.routes
// Could be related to https://github.com/fabrix-app/spool-router/issues/6
const routes = new Map([...app.routes].reverse())
const express = app.config.get('web.express')
const expressRouter = express.Router
const router = expressRouter()
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fabrix/spool-express",
"version": "1.1.3",
"version": "1.1.4",
"description": "Spool Express - Binds the routes compiled in spool-router to a Express 4 Server.",
"homepage": "https://fabrix.app",
"author": "Fabrix-app Team <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('express controllers', () => {
})
})
// TODO fix spool-router and come back to this
it.skip('should test order', (done) => {
it('should test order', (done) => {
request
.get('/test/earth')
.query({ where: {hello: 'world'}})
Expand Down