Marj4n / hello-world-api

Home Page:https://hello-worlds-api.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hello World API

API for all hello world programming languages.

API Documentation (still in progress)

The API url is https://start-express-ts-marj4n.vercel.app/api and the following endpoints are available:

Authentication

  • POST /auth/register - Register a new user.

Required fields: username, email, password
Example request body:

{
  "email": "jokowi@gmail.com",
  "password": "jokowi12345",
  "username": "jokowi"
}
  • POST /auth/login - Login a user.

Required fields: email, password
Example request body:

{
  "email": "jokowi@gmail.com",
  "password": "jokowi12345"
}
  • GET /auth/logout - Logout a user.

Description: Only authenticated users can logout.

Users

  • GET /users - Get all users.

Description: Only authenticated users can get all users.

  • GET /users/:id - Get a user by id.

Description: Only Authenticated users can get a user by id.
Url example: http://localhost:8080/api/users/2

  • PATCH /users/:id - Update a user by id.

Description: Only the user's owner can update the user.
Url example: http://localhost:8080/api/users/2
Required fields: username
Example request body:

{
  "username": "Jamashin"
}
  • DELETE /users/:id - Delete a user by id.

Description: Only the user's owner can delete the user.
Url example: http://localhost:8080/api/users/2

Languages (still in progress)

About

https://hello-worlds-api.vercel.app/


Languages

Language:TypeScript 95.6%Language:JavaScript 4.4%