feat(react-router-v6-g4g): reload routes with Webpack
This commit is contained in:
parent
5c0a528124
commit
5883681393
|
@ -16,3 +16,4 @@
|
||||||
* [load CSS](https://masteringjs.io/tutorials/webpack/css-loader)
|
* [load CSS](https://masteringjs.io/tutorials/webpack/css-loader)
|
||||||
* [load CSS](https://webpack.js.org/loaders/css-loader/)
|
* [load CSS](https://webpack.js.org/loaders/css-loader/)
|
||||||
* [load CSS](https://blog.jakoblind.no/css-modules-webpack/)
|
* [load CSS](https://blog.jakoblind.no/css-modules-webpack/)
|
||||||
|
* [reload routes with Webpack](https://stackoverflow.com/questions/43209666/react-router-v4-cannot-get-url)
|
|
@ -5,14 +5,14 @@ export default function Create() {
|
||||||
const postData = (e) => {
|
const postData = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
//console.log('name: '+name);
|
//console.log('name: '+name);
|
||||||
const url='http://85.223.94.182:65535/entities/create';
|
const url='https://v1rgncy.api.swingbe.de/entities/create';
|
||||||
//console.log('url: '+url);
|
//console.log('url: '+url);
|
||||||
let data = new FormData();
|
let data = new FormData();
|
||||||
data.append('name',name);
|
data.append('name',name);
|
||||||
let config = {
|
let config = {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
maxBodyLength: Infinity,
|
maxBodyLength: Infinity,
|
||||||
url: 'http://83.223.94.182:65535/entities/create',
|
url: url,
|
||||||
data : data
|
data : data
|
||||||
};
|
};
|
||||||
axios.request(config)
|
axios.request(config)
|
||||||
|
|
|
@ -6,7 +6,7 @@ export default function Read() {
|
||||||
//useEffect Hook, cos we need data when app loads
|
//useEffect Hook, cos we need data when app loads
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
//console.log('Read calls useEffect()');
|
//console.log('Read calls useEffect()');
|
||||||
axios.get('http://83.223.94.182:65535/entities/info')
|
axios.get('https://v1rgncy.api.swingbe.de/entities/info')
|
||||||
.then((response)=>{
|
.then((response)=>{
|
||||||
setApiData(response.data);
|
setApiData(response.data);
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,6 +10,7 @@ module.exports = {
|
||||||
filename: '[name].bundle.js',
|
filename: '[name].bundle.js',
|
||||||
path: path.resolve(__dirname, '../dist'),
|
path: path.resolve(__dirname, '../dist'),
|
||||||
clean: true,
|
clean: true,
|
||||||
|
publicPath: '/'
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
|
|
|
@ -10,5 +10,6 @@ module.exports = merge(common, {
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
devServer: {
|
devServer: {
|
||||||
static: path.resolve(__dirname, '../dist'),
|
static: path.resolve(__dirname, '../dist'),
|
||||||
|
historyApiFallback: true
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue