Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Create production flag on the backend #35

Conversation

ptisserand
Copy link
Contributor

@ptisserand ptisserand commented Apr 11, 2024

A --production flag on the backend to disable devnet related routes.

@ptisserand
Copy link
Contributor Author

Hi @b-j-roberts , do you think I should try to use context instead of this really simple implementation ?

@b-j-roberts
Copy link
Contributor

b-j-roberts commented Apr 12, 2024

Hi @b-j-roberts , do you think I should try to use context instead of this really simple implementation ?

Thought about this some. I think the best option would be to add the "production" option to the backendConfig which are passed from the backend .config.json files here https://github.com/keep-starknet-strange/art-peace/tree/main/configs and parsed in go here https://github.com/keep-starknet-strange/art-peace/blob/main/backend/config/backend.go

Then the production flag will act as an override of that config option, which will be defaulted to false.

You might need to swap the order of InitRoutes and NewBackend in main.go so the global variables are setup.
Hope that makes sense

@ptisserand ptisserand force-pushed the feat/3-create-production-flag-on-backend branch from b6a03f8 to a1124ba Compare April 14, 2024 23:19
@ptisserand ptisserand marked this pull request as ready for review April 14, 2024 23:28
@ptisserand ptisserand requested a review from b-j-roberts as a code owner April 14, 2024 23:28
@ptisserand
Copy link
Contributor Author

Hi @b-j-roberts I have updated the PR according to your last comments.

Should I also add production in JSON config files?

backend/routes/templates.go Show resolved Hide resolved
backend/main.go Show resolved Hide resolved
Copy link
Contributor

@b-j-roberts b-j-roberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@b-j-roberts b-j-roberts merged commit 96d36f6 into keep-starknet-strange:main Apr 16, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants