// @flow

/**
 * Main application routes
 */

import type { $Application, $Request, $Response } from "express";

import Api from "./api";
import Auth from "./auth";
import { pageNotFound } from "./components/errors";
import path from "path";

function defaultRouteHandler(req: $Request, res: $Response) {
  res.render(path.join(__dirname, "../client/index.html"));
}

export default function init(app: $Application) {
  app.use("/api", Api);

  app.use("/auth", Auth);

  // All undefined asset or api routes should return a 404
  app
    .route("/:url(api|auth|components|app|bower_components|assets)/*")
    .get(pageNotFound);

  // All other routes should redirect to the index.html
  app.route("/*").get(defaultRouteHandler);
}

@@ -236,16 +236,185 @@
 path%22;%0A%0A
+const indexHtml =%0A  process.env.NODE_ENV === %22development%22%0A    ? path.join(__dirname, %22../client/index.html%22)%0A    : path.join(__dirname, %22../build/client/index.html%22);%0A%0A
 function
@@ -484,52 +484,17 @@
 der(
-path.join(__dirname, %22../client/
 index
-.h
+H
 tml
-%22)
 );%0A%7D

Update index html path