Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(server): make ssr properly return 404
Browse files Browse the repository at this point in the history
  • Loading branch information
ball6847 committed Feb 10, 2018
1 parent 2588c91 commit 4123286
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/ssr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* @desc
*/
import React from 'react'
import _ from 'lodash'
import {renderToNodeStream} from 'react-dom/server'
import {ServerStyleSheet, StyleSheetManager} from 'styled-components'
import {configureRootComponent, configureApp} from 'common/app'
Expand Down Expand Up @@ -42,8 +41,9 @@ export default async (req: express$Request, res: express$Response) => {
</AsyncComponentProvider>
)

// match url against browseable routes
// if true - > throw 404, if match found -> 200
const noRequestURLMatch = !_.find(routes, a => matchPath(req.url, a.path))
const noRequestURLMatch = !routes.filter(r => !!r.path).find(r => matchPath(req.url, r))

asyncBootstrapper(app).then(() => {
const appStream = renderToNodeStream(app)
Expand Down

0 comments on commit 4123286

Please sign in to comment.