-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Split API and WebApp routes #2376
Conversation
151070b
to
b717c37
Compare
Pull Request Test Coverage Report for Build 67d739b8-53c0-4bab-b3c4-225c6512606f
💛 - Coveralls |
4c7f331
to
3652aa2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you've forgot to add a CHANGELOG entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I set export DISABLE_WEBAPP=true
before launch
- Indexer still works - I see new blocks. It shouldn't
- I don't see
api_docs
view on the path. Instead, I see web app main page.
@vbaranov Maybe I should add new ENV var
The router gets ENV vars on compile-time, so you need recompile BS with that vars $ DISABLE_WEBAPP=true mix compile --force |
8468768
to
1e4de6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saneery I set these env vars:
DISABLE_READ_API=true
API_URL=https://localhost:3000
I expect, that write API is working in this case on the application side, but when I open http://localhost:4000/api?module=contract&action=verify
it gives me 404 error
I confirm that I set those vars before compiling.
d2f473e
to
cc4de01
Compare
cc4de01
to
843800f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I don't set any of new env vars, I expect that app should work in a full mode, but when I go to any item in APIs menu the application shows me 404 page instead of (eth) api docs or graphiql
@vbaranov I don't know how to reproduce your issue |
@saneery yes, I should revoke my last review. I tested all possible combinations of parameters. Seems, it works. Please resolve merging conflicts. And you didn't update |
And it is odd that all tests on the real node failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests are failing
** (CompileError) test/block_scout_web/controllers/api/v1/health_controller_test.exs:15: undefined function api_v1_health_path/2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question
#2364
Motivation
To launch API endpoints separately from the web application.
There are three groups of endpoints:
Changelog
DISABLE_WEBAPP=true
DISABLE_READ_API =true
DISABLE_INDEXER=true
DISABLE_WRITE_API =true
WEBAPP_URL=http://host/path
API_URL=http://host/path