Skip to content

Commit

Permalink
Merge pull request #194 from tannerwheeler/skyler.cain/update-readme
Browse files Browse the repository at this point in the history
README.md / local.env example
  • Loading branch information
Skylude authored Jun 14, 2024
2 parents f5dfa42 + 75a13c5 commit fd10675
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
- [Backend](/backend/README.md)

## Helpful Commands

### Environment Variables
We use dotenv and a local.env to store all environment variables.
Please copy config/local.env.example to config/local.env and update
any environment variables.

### Clear and Re-run Migrations
Sometimes you need to clear out migrations due to a model change.
While we are in early development we've decided to drop and recreate
Expand Down
4 changes: 2 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ There are 5 major steps to creating or editing an endpoint.
#### **GET and POST Handlers**
The following links to the current penalty API handlers. Use this as an example for creating new handlers so everything in the backend follows a similar pattern.

- [Example Penalties API Handler](/backend/internal/server/apis/stats/penalty.go)
- [Example Penalties API Handler](/backend/internal/server/apis/sports/stats/penalty.go)

4. Add in any handlers to the init function
``` go
Expand All @@ -59,7 +59,7 @@ The following link is to an example .go file containing methods to be used as an
2. Create or update the corresponding .yml file to correctly reflect any changes you have made.

3. Use the following linked .yml file to keep the documentation consistent throughout the backend.
- [Example .yml file](/static/oas/v1/stats/penalties.yml)
- [Example .yml file](/static/oas/v1/sports/stats/penalties.yml)

## Adding and Updating Unit Testing for Database Model
Adding a unit test for a database model. These tests will be using a docker spin up of the actual database for testing the database interfacing functions.
Expand Down
2 changes: 1 addition & 1 deletion backend/internal/middleware/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Setup(app *fiber.App) {
log.Alert("Setting permissive CORS")
// CORS https://docs.gofiber.io/api/middleware/cors /
app.Use(cors.New(cors.Config{
AllowOrigins: "*",
AllowOrigins: "http://localhost:9002",
AllowCredentials: true,
AllowMethods: "POST, GET, OPTIONS, PUT, DELETE",
AllowHeaders: "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, Cookie",
Expand Down
3 changes: 3 additions & 0 deletions config/local.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POWERPLAY_JWT_SECRET=your_secret_here
POWERPLAY_PASSWORD_KEY=your_secret_here
POWERPLAY_PORT=9002

0 comments on commit fd10675

Please sign in to comment.