Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: barajs/express
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.3
Choose a base ref
...
head repository: barajs/express
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5.4
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Nov 6, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2da017f View commit details
  2. chore(release): 1.5.4 [skip ci]

    ## [1.5.4](v1.5.3...v1.5.4) (2019-11-06)
    
    ### Bug Fixes
    
    * **flow:** move whenAnyPost to bottom of the registration flows ([2da017f](2da017f))
    semantic-release-bot committed Nov 6, 2019
    Copy the full SHA
    2f18baf View commit details
Showing with 23 additions and 11 deletions.
  1. +7 −0 CHANGELOG.md
  2. +1 −1 package-lock.json
  3. +1 −1 package.json
  4. +14 −9 src/flow/post.ts
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.5.4](https://github.com/barajs/express/compare/v1.5.3...v1.5.4) (2019-11-06)


### Bug Fixes

* **flow:** move whenAnyPost to bottom of the registration flows ([2da017f](https://github.com/barajs/express/commit/2da017f1e07c7ccda206964c9f3dd09f23f1fda5))

## [1.5.3](https://github.com/barajs/express/compare/v1.5.2...v1.5.3) (2019-11-06)


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": "@barajs/express",
"version": "1.5.3",
"version": "1.5.4",
"description": "Bara Express integration module",
"repository": {
"type": "git",
23 changes: 14 additions & 9 deletions src/flow/post.ts
Original file line number Diff line number Diff line change
@@ -9,15 +9,6 @@ import {
} from '../types'
import { hasQuery, hasPath, hasMountPoint } from '../seep'

export const whenAnyPost = flow<WhenRequest, Application, ExpressMold>({
bootstrap: ({ context: expressApp, next }) => {
expressApp.post('*', (request: Request, response: Response) => {
next({ request, response })
})
},
seep: { hasPostQuery: hasQuery, hasPostPath: hasPath },
})

export const whenCustomPost = flow<WhenCustomRoute, Application, ExpressMold>({
bootstrap: ({ context: expressApp, mold, next }) => {
if (!mold.routes) return
@@ -56,3 +47,17 @@ export const whenCustomPost = flow<WhenCustomRoute, Application, ExpressMold>({
hasPostPath: hasPath,
},
})

/**
* This flow must be place in the most end of this file because
* Express do register the route in order, if put this function
* before any get route, it would overlap all the route below it.
*/
export const whenAnyPost = flow<WhenRequest, Application, ExpressMold>({
bootstrap: ({ context: expressApp, next }) => {
expressApp.post('*', (request: Request, response: Response) => {
next({ request, response })
})
},
seep: { hasPostQuery: hasQuery, hasPostPath: hasPath },
})