This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from UCBoulder/Bookstore-Updates-to-Low-Cost-No…
…-Cost-and-OER-Fields update the readme; slim down the image
- Loading branch information
Showing
2 changed files
with
34 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,43 @@ | ||
# Bookstore REST API | ||
|
||
Provides RESTful API interface(s) for UCB Bookstore data. | ||
|
||
Config variables -- other than those passed in by environment are in the config.py file. | ||
|
||
To run the app in local development with reload, | ||
``` | ||
GRAPHQL_KEY=hasura_graphql_api_key BASIC_USERNAME=books BASIC_PASSWORD=default uvicorn app.main:app --reload | ||
``` | ||
## Local Development | ||
|
||
In Windows, this works too: | ||
``` | ||
set GRAPHQL_KEY=*********** set BASIC_USERNAME=books set BASIC_PASSWORD=password uvicorn app.main:app --reload | ||
### Environment Vars | ||
|
||
Set environment variables for GRAPHQL_KEY, BASIC_USERNAME, and BASIC_PASSWORD. For ex: | ||
|
||
```shell | ||
#bash | ||
export KEYNAME="123" | ||
|
||
#windows cmd | ||
set KEYNAME=123 | ||
|
||
#windows powershell | ||
$Env:KEYNAME="123" | ||
``` | ||
|
||
### Format, Lint, Test, and Run | ||
|
||
1. To format your code, run `make format` | ||
1. To lint your code, run `make lint` | ||
1. To test your code, run `make tests` | ||
1. To run uvicorn locally, run `make uvicorn-run` | ||
|
||
## Container'ing | ||
|
||
``` | ||
docker build -t bookstore-api . | ||
docker run -d --name bookstore-api \ | ||
-p 8988:80 \ | ||
-e GRAPHQL_KEY=**** \ | ||
-e BASIC_USERNAME=books \ | ||
-e BASIC_PASSWORD=password \ | ||
bookstore-api | ||
### Build | ||
|
||
```shell | ||
make docker-build | ||
``` | ||
|
||
### Run | ||
|
||
```shell | ||
make docker-run | ||
``` |