Acebots-AI / my-tiny-service

0 stars 1 forks source link

Add endpoint that returns current timestamp #32

Closed artmoskvin closed 4 months ago

artmoskvin commented 4 months ago

The timestamp should be in the ISO format

acebots-ai[bot] commented 4 months ago

To add an endpoint that returns the current timestamp in ISO format to the project, here's a plan for implementation:

  1. Create a New Endpoint Function: Add a new function in the my_tiny_service/api/routers/root.py file since it seems to be the place where simple endpoints are defined. This function will handle requests to the new endpoint.

  2. Implement Timestamp Logic: Within the new function, use Python's datetime module to get the current time and format it to ISO format using the isoformat() method.

  3. Register the Endpoint: Add the new function as an endpoint to the router object in my_tiny_service/api/routers/root.py using the @router.get() decorator. Specify the path and response model if necessary.

  4. Update Tests: Add a new test function in tests/test_api.py to ensure the new timestamp endpoint works as expected. This test should check if the endpoint returns a valid ISO formatted timestamp.

  5. Documentation and Comments: Ensure to add comments and update any relevant documentation within the project to reflect the addition of the new endpoint.

artmoskvin commented 4 months ago

@acedev-ai looks good, let's proceed

acebots-ai[bot] commented 4 months ago

The implementation for adding an endpoint that returns the current timestamp in ISO format has been completed, and a pull request has been created:

This pull request includes:

You can review and merge the pull request to integrate this new feature into the project.