Skip to content

Feature Request: Add a scalable api-client.ts wrapper for backend API operations #172

@Rushi0508

Description

@Rushi0508

It would be helpful to add a simple api-client.ts file to handle all API requests in a consistent way.
It wraps axios and works on both client and server using next-auth for session-based auth. It also auto-trims data, handles common HTTP methods, and returns a clear success/error response.

Here’s a reference of my repo:
https://github.com/Rushi0508/my-next-nest-template/blob/master/web/lib/api-client.ts

This makes API calls easier to manage and scales well if the backend changes.

Happy to raise a PR if this sounds useful. @leerob

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions