Skip to content

simple API using tRPC, zod, node, typescript and typeorm w/ local database

Notifications You must be signed in to change notification settings

kmlyteixeira/api-trpc-node-typeorm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api-trpc-node-typeorm

A simple API using tRPC, NodeJS, TS & TypeORM w/ local MySQL database


EndPoint tRPC playground

\playgroung

Functions

  • getUser(id: number)

    Retrieves a user with the specified id.

    🔎 Request:

    await trpc.getUser.query(<user_id>)

    🔍 Response:

        {
          id: <user_id>,
          name: <user_name>
        }
  • getUsers

    Retrieves a list of all users.

    🔎 Request:

    await trpc.getUsers.query()

    🔍 Response:

      [
        {
          id: <user_id>,
          name: <user_name>
        },
        {
          id: <user_id>,
          name: <user_name>
        }
      ]
  • deleteUser(id: number)

    Deletes the user with the specified id.

    🔎 Request:

    await trpc.deleteUser.query(<user_id>)

    🔍 Response:

    {
      result: true
    }
  • updateUser(id: number, name: string)

    Updates the name of the user with the specified id.

    🔎 Request:

    await trpc.updateUser.query(<user_id>, <user_name>)

    🔍 Response:

    {
      id: <user_id>,
      name: <new_user_name>
    }
  • createUser(name: string)

    Creates a new user with the specified name.

    🔎 Request:

    await trpc.createUser.query(<user_name>)

    🔍 Response:

    {
      id: <user_id>,
      name: <user_name>
    }

About

simple API using tRPC, zod, node, typescript and typeorm w/ local database

Topics

Resources

Stars

Watchers

Forks