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 returns 404
Browse files Browse the repository at this point in the history
  • Loading branch information
Metnew committed Feb 19, 2018
1 parent cb7d127 commit 972580d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 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 {renderToString} from 'react-dom/server'
import {ServerStyleSheet, StyleSheetManager} from 'styled-components'
import {configureRootComponent, configureApp} from 'common/app'
Expand Down Expand Up @@ -42,7 +41,7 @@ export default async (req: express$Request, res: express$Response) => {

const routes = getRouterRoutes()
// 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 renderedApp = renderToString(app)
Expand Down

0 comments on commit 972580d

Please sign in to comment.