Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIs Design #1

Open
Zain-ul-din opened this issue Jan 25, 2023 · 0 comments
Open

APIs Design #1

Zain-ul-din opened this issue Jan 25, 2023 · 0 comments
Assignees
Labels
desgin framework APIs Design documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@Zain-ul-din
Copy link
Member

Zain-ul-din commented Jan 25, 2023

APIS Design Document

Introduction

Randomsts is a free and open-source framework for building restful APIS using typescript and class-based object-oriented programming.

Key Features

  • File-base routing.
  • Hot-reloading.
  • Type safety.
  • Intuitive APIs.

APIs Design General Thoughts

  • client class will extend class Router to initialize the route.
  • client class must have a ts-decorator @init() to emit meta data about file.
  • override base methods to create APIs controller.
  • export default instance of the class.

Example

import Route from 'pkg'

@Route.init ()
class ClientRoute extends Route 
{
    public async get (req: RequestType, res: ResponseType): Promise<void> {
        res.send ("hello world");
    }
}

export = new ClientRoute ();

@zainuldeen working...

@Zain-ul-din Zain-ul-din added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed desgin framework APIs Design labels Jan 25, 2023
@Zain-ul-din Zain-ul-din added this to the V 1.0.1B milestone Jan 25, 2023
@Zain-ul-din Zain-ul-din self-assigned this Jan 25, 2023
@Zain-ul-din Zain-ul-din moved this from Todo to In Progress in Randoms Restful APIs framework Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desgin framework APIs Design documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: In Progress
Development

No branches or pull requests

2 participants