feat(react-router-v6-g4g): reload routes with Webpack

This commit is contained in:
dancingCycle 2023-09-21 13:56:21 +02:00
parent 5c0a528124
commit 5883681393
5 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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);
});

View File

@ -10,6 +10,7 @@ module.exports = {
filename: '[name].bundle.js',
path: path.resolve(__dirname, '../dist'),
clean: true,
publicPath: '/'
},
module: {
rules: [

View File

@ -10,5 +10,6 @@ module.exports = merge(common, {
devtool: 'inline-source-map',
devServer: {
static: path.resolve(__dirname, '../dist'),
historyApiFallback: true
},
});