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]: Implement an Endpoint to Display Backend Info #358

Open
7 tasks
deolla opened this issue Jul 28, 2024 · 0 comments
Open
7 tasks

[FEAT]: Implement an Endpoint to Display Backend Info #358

deolla opened this issue Jul 28, 2024 · 0 comments
Labels

Comments

@deolla
Copy link
Contributor

deolla commented Jul 28, 2024

Description

Add /hng-test Page to Display Version, Backend URL, and API Response

Accepted Criteria

  • Create a New Page:

    • Add a new page in the frontend repository at the route /hng-test.
    • On this page, display the text "Version 0.12".
  • Display Backend URL:

    • Ensure the environment variables are properly configured in the frontend project.
    • Display this backend URL on the page.
  • Call the Backend API:

    • Make an API call to the backend endpoint /probe.
    • The backend should respond with a message like "I am the express api responding".
    • Display this response on the page.

Requirements

  • Create a new route /hng-test in the frontend project.
  • Display the static text "Version 0.12".
  • Use environment variables to fetch and display the backend URL.
  • Make an API call to /probe endpoint on the backend server.
  • Display the response from the backend API on the page.

Response:

Success response

Version 0.12
Backend URL: <backend_url_from_env>
Backend Response: I am the express api responding

Error Response

Version 0.12
Backend URL: <backend_url_from_env>
Backend Response: { "error": "Failed to connect to backend" }

Notes:

  • Ensure the environment variables are properly configured in the frontend project.
  • Ensure the backend URL is read from the environment variables to support different environments (development, staging, production).
  • Verify the API response from /probe and handle any errors gracefully.
@AdeGneus AdeGneus changed the title Add /hng-test Page to Display Version and Backend Info [FEAT]: Implement an Endpoint to Display Backend Version and Info Jul 30, 2024
@AdeGneus AdeGneus changed the title [FEAT]: Implement an Endpoint to Display Backend Version and Info [FEAT]: Implement an Endpoint to Display Backend Info Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants