Browse Source

L10 Clean URLs.

Frederic G. MARAND 8 years ago
parent
commit
bc00a8694f
4 changed files with 5 additions and 5 deletions
  1. 0 0
      index.css
  2. 2 2
      index.html
  3. 2 2
      index.js
  4. 1 1
      package.json

+ 0 - 0
styles.css → index.css


+ 2 - 2
index.html

@@ -3,11 +3,11 @@
   <head>
     <meta charset=utf-8/>
     <title>My First React Router App</title>
-    <link rel="stylesheet" href="styles.css" />
+    <link rel="stylesheet" href="/index.css" />
   </head>
 
   <body>
     <div id=app></div>
-    <script src="bundle.js"></script>
+    <script src="/bundle.js"></script>
   </body>
 </html>

+ 2 - 2
index.js

@@ -5,10 +5,10 @@ import React from "react";
 import Repos from "./modules/Repos";
 import Repo from "./modules/Repo";
 import { render } from "react-dom";
-import { IndexRoute, Router, Route, hashHistory } from "react-router";
+import { IndexRoute, Router, Route, browserHistory as history} from "react-router";
 
 render((
-  <Router history={hashHistory}>
+  <Router history={history}>
     <Route path="/" component={App}>
       <IndexRoute component={Home} />
       <Route path="/repos" component={Repos}>

+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "description": "",
   "main": "index.js",
   "scripts": {
-    "start": "webpack-dev-server --inline --content-base ."
+    "start": "webpack-dev-server --inline --content-base . --history-api-fallback"
   },
   "author": "",
   "license": "ISC",