Wire node-static deploy for chat_web_app (closes #13).
Unit Tests / test (pull_request) Successful in 21s

Add build:prod/beta webroot scripts, Gitea CI/deploy workflows, and bake API
URLs from REACT_APP_* so hosts can deploy via server-infra like dta_webapp.
This commit is contained in:
2026-07-25 06:26:29 -05:00
parent 8dcdda202c
commit 3710a7f4aa
8 changed files with 156 additions and 8 deletions
+2
View File
@@ -0,0 +1,2 @@
REACT_APP_BACKEND_REST_API_BASE_URL=https://beta.chatbackend.aimloperations.com/api/
REACT_APP_BACKEND_WS_API_BASE_URL=wss://beta.chatbackend.aimloperations.com/ws/chat_again/
+2
View File
@@ -40,6 +40,8 @@
"scripts": {
"start": "NODE_ENV=development react-scripts start",
"build": "NODE_ENV=production react-scripts build",
"build:prod": "NODE_ENV=production react-scripts build && mkdir -p /var/www/prod.chat.aimloperations/html && cp -r ./build/* /var/www/prod.chat.aimloperations/html/",
"build:beta": "bash -c 'set -a; source .env.beta; set +a; NODE_ENV=production react-scripts build' && mkdir -p /var/www/beta.chat.aimloperations/html && cp -r ./build/* /var/www/beta.chat.aimloperations/html/",
"test": "NODE_ENV=development react-scripts test",
"test:ci": "CI=true NODE_ENV=development react-scripts test --watchAll=false --coverage=false",
"eject": "react-scripts eject"
+1 -3
View File
@@ -1,9 +1,7 @@
import axios from "axios";
const Cookies = require("js-cookie");
const baseURL = "http://localhost:8011/api/";
//const baseURL = 'https://chatbackend.aimloperations.com/api/';
//const baseURL = process.env.REACT_APP_BACKEND_REST_API_BASE_URL;
const baseURL = process.env.REACT_APP_BACKEND_REST_API_BASE_URL;
export const axiosInstance = axios.create({
baseURL: baseURL,
@@ -70,11 +70,7 @@ function WebSocketProvider({ children }) {
useEffect(() => {
/* WS initialization and cleanup */
if (account) {
ws.current = new WebSocket(`ws://localhost:8011/ws/chat_again/`);
//ws.current = new WebSocket(`ws://localhost:8011/ws/conditional_chat/`);
//ws.current = new WebSocket('wss://chatbackend.aimloperations.com/ws/chat_again/')
//ws.current = new WebSocket('wss://chatbackend.aimloperations.com/ws/conditional_chat/')
//ws.current = process.env.REACT_APP_BACKEND_WS_API_BASE_URL;
ws.current = new WebSocket(process.env.REACT_APP_BACKEND_WS_API_BASE_URL);
ws.current.onopen = () => {
setSocket(ws.current);