Skip to content

Commit

Permalink
fix: add api env variable (#9) (#10)
Browse files Browse the repository at this point in the history
* fix: add api env variable

* fix: add yml env
  • Loading branch information
korsun authored May 1, 2024
1 parent 88c0deb commit e74860d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ OPENROUTESERVICE_API_KEY='5b3ce3597851110001cf62481766f58b063741c9977ec6ce848a72
GEOAPIFY_API_KEY='c9d16928a77b4f1185aff845ae4e73da'
THUNDERFOREST_API_KEY='7d9fefffc2984231af5a54c5e4ad0a83'
MAPTILER_API_KEY='ldgujGplx520Q0a3WG1f'

# API_BASE_URL='https://roamus-server.vercel.app'
API_BASE_URL='http://localhost:4000'
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ THUNDERFOREST_API_KEY=

# https://cloud.maptiler.com/maps
MAPTILER_API_KEY=

# https://roamus-server.vercel.app
API_BASE_URL='https://localhost:4000'
1 change: 1 addition & 0 deletions .github/workflows/dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
GEOAPIFY_API_KEY: ${{ secrets.GEOAPIFY_API_KEY }}
THUNDERFOREST_API_KEY: ${{ secrets.THUNDERFOREST_API_KEY }}
MAPTILER_API_KEY: ${{ secrets.MAPTILER_API_KEY }}
API_BASE_URL: ${{ secrets.API_BASE_URL }}

- name: Lint
run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/fetchRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { apiService } from '@/services';

export const fetchRoute = async (payload: ProxyServerPayload) => {
return apiService.post({
url: 'http://localhost:4000/api/routing',
url: `${process.env.API_BASE_URL}/api/routing`,
payload,
});
};
8 changes: 3 additions & 5 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ app.get('/', (_, res) => {

app.use(errorHandler);

app.set('port', 4000);
const PORT = process.env.PORT || 4000;

app.listen(app.get('port'), () =>
app.listen(PORT, () =>
// eslint-disable-next-line no-console
console.log(
`${'\u001b[1;34m'}Server listening on port ${app.get('port')} πŸš€πŸš€πŸš€`,
),
console.log(`${'\u001b[1;34m'}Server listening on port ${PORT} πŸš€πŸš€πŸš€`),
);

0 comments on commit e74860d

Please sign in to comment.