development flag in ansible role for redirecting to webpack dev server

This commit is contained in:
sneakers-the-rat 2023-07-25 16:11:42 -07:00
parent dea1b6b8e4
commit 8eb7ad213e
4 changed files with 16 additions and 4 deletions

View file

@ -14,7 +14,7 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "NODE_ENV=development webpack serve -c ./config/webpack.dev.js --mode development",
"start": "NODE_ENV=development webpack -c ./config/webpack.dev.js --mode development",
"build": "NODE_ENV=production webpack --config ./config/webpack.prod.js",
"test": "react-scripts test",
"eject": "react-scripts eject"

View file

@ -1,5 +1,9 @@
---
# defaults file for chatbridge
CHATBRIDGE_MODE: development
# development options
chatbridge_webpack_port: 8080
chatbridge_postgres_user: chatbridge
chatbridge_postgres_password: CHANGEME

View file

@ -7,6 +7,13 @@ server {
proxy_pass http://127.0.0.1:{{ chatbridge_api_port }}/;
}
{% if CHATBRIDGE_MODE == "development" %}
location {{ chatbridge_webroot }}/ {
proxy_pass http://127.0.0.1:{{ chatbridge_webpack_port }}/;
}
{% else %}
location {{ chatbridge_webroot }} {
root {{ chatbridge_user_home }}/public;
try_files $uri $uri/ $uri/index.html /index.html index.html;
@ -17,5 +24,6 @@ server {
root {{ chatbridge_user_home }}/public;
try_files $uri $uri/ $uri/index.html =404;
}
{% endif %}
}

View file

@ -6,6 +6,6 @@ import {Group} from "../entities/group.entity";
import {AppDataSource} from "../db/data-source";
export const updateGroup = async(name:string){
}
// export const updateGroup = async(name:string){
//
// }