Skip to content

Commit

Permalink
Merge pull request #127 from ConservationInternational/client/prepari…
Browse files Browse the repository at this point in the history
…ng-production-server

setting up the production server for client app
  • Loading branch information
davidsingal authored Mar 29, 2023
2 parents 9a89211 + 94f3bd9 commit 455e030
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
8 changes: 1 addition & 7 deletions frontend/config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
server '52.54.50.38', user: 'ubuntu', roles: %w{web app db}, primary: true
server 'app.resilienceatlas.org', user: 'ubuntu', roles: %w[web app db], primary: true

set :ssh_options, {
forward_agent: true,
auth_methods: %w(publickey)
}

set :rvm_custom_path, '/home/ubuntu/.rvm'
set :node_env, 'production'
set :branch, 'master'
2 changes: 0 additions & 2 deletions frontend/src/state/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { merge } from 'utilities/helpers';
export const isProd = process.env.NODE_ENV === 'production';

export const PORT = process.env.NEXT_PUBLIC_API_HOST;
// uncomment this line to see map layers quickly for local testing
// export const PORT = 'https://staging.resilienceatlas.org';

const defaultConfig = {
baseURL: `${PORT}/api`,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/utilities/getSubdomain.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PORT, isProd } from '../state/utils/api';
import { isProd } from '../state/utils/api';
import { getRouterParam } from './routeParams';

export const getSubdomainFromURL = (url: string): string => {
Expand All @@ -19,7 +19,7 @@ export const getSubdomain = (): string => {
const siteScope = getRouterParam('site_scope');
if (siteScope && !isProd) return siteScope;
// Site scope depends on the domain set in the API
const subdomain = getSubdomainFromURL(PORT);
const subdomain = getSubdomainFromURL(window.location.hostname);
return subdomain;
};

Expand Down

0 comments on commit 455e030

Please sign in to comment.