Unable to get / error run hello world in webpack

Full Github project: https://github.com/pbrianmackey/uiexperiment

I launched

webpack-dev-server --content-base deployment/

Then go to http://localhost:8080/ , Error

Impossible GET /

I think the problem is in the wrong webpack configuration. I checked the webpack.config.js file and see no problem. How can I fix this to get my welcome example?

This may be a routing problem. I think I can use this site without a responsive router, but I could be wrong. There are no errors in releasing web packages on the console.

index.js

 import "babel-polyfill";//for flipping IE import $ from 'jquery'; import jQuery from 'jquery'; var App = require('./app'); var React = require('react'); var ReactDOM = require('react-dom') var Hello = React.createClass({ render: function() { return <div>Hello {this.props.name}</div>; } }); ReactDOM.render( <Hello name="World" />, document.getElementById('container') ); 
+12
reactjs webpack-dev-server
source share
3 answers

Turns out I had index.html in the wrong place. From the docs webpage:

To load your attached files, you need to create the index.html file in the assembly folder from which static files are served (-content-base option).

I made a copy of index.html in a new folder that I called deployment to match what I specified in output.path

+19
source share

In the web package put this:

 devServer: { historyApiFallback: true, }, 
0
source share

The webpack-dev-server documentation has a writeToDisk option to solve this docs problem. It will store all files on disk, not in memory. Example from my config:

 devServer: { port: 3000, writeToDisk: true, proxy: { '/': 'http://localhost:8080' } } 
0
source share

All Articles