Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Move website to custom domain
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-asriyan committed Jun 24, 2020
1 parent 9388fe0 commit bbb44a0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ RUN npm install
ADD src ./src
ADD public ./public

ENV url=/
RUN npm run build

# copy generated files
RUN mkdir -p /usr/html/ && cp -R build/. /usr/html/

# remove unnecessary source files
# remove unnecessary files
RUN rm -fr /application
RUN apk del nodejs npm git

ADD nginx.conf /etc/nginx/nginx.conf
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "frontend-admin",
"version": "0.1.0",
"private": true,
"homepage": "/admin",
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
Expand Down
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const pages = {
key: 'key'
};

export const baseUrl = `https://meter4.me`;
export const baseUrl = process.env['url'] || `https://m4mcloud.ru`;

export class App extends React.Component {
constructor() {
Expand Down Expand Up @@ -59,7 +59,7 @@ export class App extends React.Component {
}

onLogin(campaignName, password) {
fetch(`${baseUrl}/api/admin/companies`, {
fetch(`${baseUrl}/api/companies`, {
method: 'GET',
mode: 'cors'
})
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Data extends React.Component {
const [ year, month, day ] = date.split('-');
const name = `${sensor.email}-${sensor.sensor_id}-${date}.tsv`;

fetch(`${baseUrl}/api/admin/sensors/${sensor.sensor_id}/${year}/${month}/${day}?key=${key}`, {
fetch(`${baseUrl}/api/sensors/${sensor.sensor_id}/${year}/${month}/${day}?key=${key}`, {
method: 'GET',
mode: 'cors'
})
Expand Down
2 changes: 1 addition & 1 deletion src/Sensors/Sensors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Sensors extends React.Component {
const {campaignId, userId} = this.props;

if (!sensors.length) {
fetch(`${baseUrl}/api/admin/${campaignId}/sensors/${userId}`, {
fetch(`${baseUrl}/api/${campaignId}/sensors/${userId}`, {
method: 'GET',
mode: 'cors'
})
Expand Down
2 changes: 1 addition & 1 deletion src/Users/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Users extends React.Component {
const {campaignId} = this.props;

if (!users.length) {
fetch(`${baseUrl}/api/admin/${campaignId}/users`, {
fetch(`${baseUrl}/api/${campaignId}/users`, {
method: 'GET',
mode: 'cors'
})
Expand Down

0 comments on commit bbb44a0

Please sign in to comment.