Skip to content

Commit

Permalink
Ensure app connects to local backend and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
komali2 committed Jul 5, 2023
1 parent 9984474 commit a358155
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
1 change: 1 addition & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_API_URL=http://localhost:8000
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
# frontend
# Game Remix Guesser Frontend

This is a Vue SPA managed with `vue-cli-service`.

It's the client for a web server/client application. The server can be found at https://github.com/508-dev/game-remix-guesser-backend.


## Project setup
Copy the example env to `.env`

```bash
cp .example.env .env
```

This will make environment variables such as the API url visible to `vue-cli-service`. Note that the outdated version we're using can only see environment variables that start with `VUE_APP_`.

Then, install the npm packages:

```bash
npm install
```

### Compiles and hot-reloads for development
### Run the project locally using a development server

Have the SPA run on your machine locally. Run like this, the server will update on any local file change.

```
npm run serve
```

### Compiles and minifies for production
### Compile and minify for production
```
npm run build
```

### Run your unit tests
### Run unit tests
```
npm run test:unit
```

### Run your end-to-end tests
### Run end-to-end tests
```
npm run test:e2e
```

### Lints and fixes files
### Lint and fix files
```
npm run lint
```
Expand Down
7 changes: 2 additions & 5 deletions src/store/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
const API_URL = 'api';

// if (process.env.NODE_ENV !== 'development') {
// API_URL = 'https://api-dot-game-remix-guesser.uw.r.appspot.com';
// }
// eslint-disable-next-line
const API_URL = process.env.VUE_APP_API_URL;

// eslint-disable-next-line
export function fetchApi(url: string, config?: object) {
Expand Down

0 comments on commit a358155

Please sign in to comment.