mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Add backend environment support
Add proxy for development
This commit is contained in:
parent
5d70a73773
commit
560713e901
4 changed files with 9 additions and 7 deletions
|
@ -16,9 +16,10 @@ services:
|
|||
image: villasweb-backend
|
||||
links:
|
||||
- database
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
|
||||
database:
|
||||
image: mongo:latest
|
||||
volumes:
|
||||
- /opt/database:/data/db
|
||||
|
||||
# volumes:
|
||||
# - /opt/database:/data/db
|
||||
|
|
|
@ -7,10 +7,10 @@ server {
|
|||
proxy_redirect off;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
|
||||
# rewrite url to exclude /api on context broker side
|
||||
rewrite ^/api/?(.*) /api/v1/$1 break;
|
||||
|
||||
rewrite ^/api/?(.*) /api/$1 break;
|
||||
|
||||
proxy_pass http://backend:4000/;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"name": "villasweb-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"proxy": "http://localhost:4000",
|
||||
"dependencies": {
|
||||
"bootstrap": "^3.3.7",
|
||||
"classnames": "^2.2.5",
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
import RestAPI from '../api/rest-api';
|
||||
import AppDispatcher from '../app-dispatcher';
|
||||
|
||||
const API_URL = 'http://localhost:4000/api/v1';
|
||||
const API_URL = '/api/v1';
|
||||
|
||||
class RestDataManager {
|
||||
constructor(type, url, keyFilter) {
|
||||
|
|
Loading…
Add table
Reference in a new issue