1
0
Fork 0
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:
Markus Grigull 2017-04-27 17:39:44 +02:00
parent 5d70a73773
commit 560713e901
4 changed files with 9 additions and 7 deletions

View file

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

View file

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

View file

@ -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",

View file

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