Skip to content

Accept lower case of method like axios #4743

@khaled-hossain-code

Description

@khaled-hossain-code

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

fastify.route({
    method: "get",
    url: `/`,
    handler: getAllItem
  });

should work similar to Axios

Motivation

I was creating a mock server for my front-end. I have API calls listed in axios in front-end. I wanted to reuse those params in fastify to create the mock server.

Example

export const getAccountInfo = async () => {
  try {
    const res = await apiClient({
      method: "get",
      url: `/v1/profile`,
    });
    if (res.status === 200) return res;
  } catch (error) {
    return error.response;
  }
};

I could reuse the options in both axios and fastify if fastify accepts lower case of method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions