Commit 5896bd8a authored by Zac Wood's avatar Zac Wood

Added SECRET_KEY_BASE to Dockerfile

Web now sends requests to hostname/api instead of a hard coded URL
parent d829c629
...@@ -9,5 +9,6 @@ EXPOSE 3000 ...@@ -9,5 +9,6 @@ EXPOSE 3000
ENV RAILS_ENV production ENV RAILS_ENV production
RUN bundle install RUN bundle install
RUN export SECRET_KEY_BASE=$(rails secret)
RUN rails db:migrate RUN rails db:migrate
RUN rails db:seed RUN rails db:seed
...@@ -24,7 +24,7 @@ const postJson = (endpoint: string, data: any): Promise<Response> => ...@@ -24,7 +24,7 @@ const postJson = (endpoint: string, data: any): Promise<Response> =>
}); });
const local = 'localhost:3000/api'; const local = 'localhost:3000/api';
const remote = 'schedules.zacwood.me/api'; const remote = `${window.location.hostname}/api`
const apiUrl = process.env.NODE_ENV === 'development' ? `http://${local}` : `https://${remote}`; const apiUrl = process.env.NODE_ENV === 'development' ? `http://${local}` : `https://${remote}`;
const webcalUrl = process.env.NODE_ENV === 'development' ? `webcal://${local}` : `webcal://${remote}`; const webcalUrl = process.env.NODE_ENV === 'development' ? `webcal://${local}` : `webcal://${remote}`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment