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://webpack.js.org/loaders/css-loader/)
|
||||
* [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) => {
|
||||
e.preventDefault();
|
||||
//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);
|
||||
let data = new FormData();
|
||||
data.append('name',name);
|
||||
let config = {
|
||||
method: 'post',
|
||||
maxBodyLength: Infinity,
|
||||
url: 'http://83.223.94.182:65535/entities/create',
|
||||
url: url,
|
||||
data : data
|
||||
};
|
||||
axios.request(config)
|
||||
|
|
|
@ -6,7 +6,7 @@ export default function Read() {
|
|||
//useEffect Hook, cos we need data when app loads
|
||||
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)=>{
|
||||
setApiData(response.data);
|
||||
});
|
||||
|
|
|
@ -10,6 +10,7 @@ module.exports = {
|
|||
filename: '[name].bundle.js',
|
||||
path: path.resolve(__dirname, '../dist'),
|
||||
clean: true,
|
||||
publicPath: '/'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
|
@ -10,5 +10,6 @@ module.exports = merge(common, {
|
|||
devtool: 'inline-source-map',
|
||||
devServer: {
|
||||
static: path.resolve(__dirname, '../dist'),
|
||||
historyApiFallback: true
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue