Compare commits

...

5 Commits

Author SHA1 Message Date
9529f5d17b Use ENV vars instead of hardcoded 2021-01-17 19:56:50 -05:00
b8739d2eca Updated docs 2021-01-17 19:56:20 -05:00
781758f0a5 Added default .htaccess 2021-01-17 19:55:21 -05:00
a305ad60f4 Added default env file 2021-01-17 19:55:00 -05:00
42cadebb64 Updated docs 2021-01-17 19:34:19 -05:00
6 changed files with 42 additions and 3 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local

View File

@ -25,4 +25,28 @@ npm run build
The development server will start on `http://localhost:3000`
Get css docs here https://materializecss.com/
Get css docs here https://materializecss.com/
Default .htaccess file
```
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>
```
env variables
```
REACT_APP_SITE_URL=SITEURL
REACT_APP_API_ADDRESS=ADDRESS
REACT_APP_API_KEY=APIKEY
```

3
env.default Normal file
View File

@ -0,0 +1,3 @@
REACT_APP_SITE_URL=SITEURL
REACT_APP_API_ADDRESS=ADDRESS
REACT_APP_API_KEY=APIKEY

11
public/.htaccess Normal file
View File

@ -0,0 +1,11 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>

View File

@ -3,5 +3,5 @@ import axios from "axios";
// Axios create, exporting callAPI
export const callAPI = axios.create({
baseURL: "https://devapi.benjamyn.love/migrations/",
baseURL: process.env.REACT_APP_API_ADDRESS,
});

View File

@ -9,7 +9,7 @@ function Msgbox(props) {
<span className="card-title">
{ props.error ? <span> { "Unable to update: " + props.error } </span> : null }
{ props.msg ? <span className="white-text">{ "Updated migration details for: " + props.msg }</span> : null }
{ props.linkid ? <a href={ "https://devui.benjamyn.love/migrations/" + props.linkid } className="white-link">{"https://devui.benjamyn.love/migrations/" + props.linkid }</a> : null }
{ props.linkid ? <a href={ process.env.REACT_APP_SITE_URL + props.linkid } className="white-link">{process.env.REACT_APP_SITE_URL + props.linkid }</a> : null }
</span>
</center>
</div>