3.2.1 • Published 4 months ago

easy-api.ts v3.2.1

Weekly downloads
-
License
Read licence in L...
Repository
-
Last release
4 months ago

EASY-API.TS

A powerful library to create your own API with ease.

img

Features

  • 🚀 Optimized and advanced codes and functions.
  • 📝 Easy to learn.
  • 📚 Constant updates.
  • 🔥 Image manipulation.

Install

npm i easy-api.ts

Check documentation here and join our support server.

Setup

const { API } = require('easy-api.ts');

const api = new API({
    reverse: false
});

// Lets load our endpoints...
api.load('./routes').then(() => {
    console.log('Source loaded.')
    api.connect({ port: 4500 }) // Now we're starting the API bcuz the source is ready
});

Route example

module.exports["route"] = {
    url: '/color',
    method: "GET",
    code: `
    $ignore: [Check docs to see how does functions work ;)]
    $if: [$or: [$query: [hex]==null;$isValidHex: [$query: [hex]]==false];
        $reply: [
            $setCode: [400]
            $setType: [json]
            $setBody: [{
                "error": "Invalid hex color code provided"
            }]
        ]
        $break $ignore: [Now we're breaking it to stop executing the left code.]
    ]

    $createCanvas: [
        $setDimentions:[512;512]
        $color:[$query:[hex]]
        $drawRect:[0;0;512;512]
    ]
    $reply:
    [
        $setCode: [200]
        $setType: [canvas]
        $setBody: [$default]
    ]
    `
};

EASY-API.TS LICENSE

By using "easy-api.ts" you agree to the license terms and all conditions and consequences of not following these guidelines.

Declaration of rights

The complete code of "easy-api.ts" is copyrighted, and any unauthorized distribution of the code will be removed immediately.

Read-Only Code

The code is "read-only", this means that the code can only be used for reading purposes and cannot be modified, distributed, sublicensed or used to create derivative works.

Limitations of liability

We shall be excluded from any liability for damages or problems arising from the use of the code.

Intellectual identity protection

All intellectual property rights, including copyrights, patents, or other rights are and shall remain the exclusive property of Mid and any legal entity representing Mid.

Made with ❤️ by Moonlight Group

3.2.1

4 months ago

3.2.0

4 months ago

3.1.3

7 months ago

3.1.4

6 months ago

3.1.2

7 months ago

3.1.1

8 months ago

3.1.0

8 months ago

3.0.2

9 months ago

3.0.1

9 months ago

3.0.0

9 months ago

2.2.1

10 months ago

2.2.2

10 months ago

2.2.0-bt

11 months ago

2.2.0

1 year ago

2.2.0-at

12 months ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1-at

2 years ago

1.0.0

2 years ago

1.0.0-alphaT5

2 years ago

1.0.0-alphaT4

2 years ago

1.0.0-alphaT2

2 years ago

1.0.0-alphaT1

2 years ago

1.0.0-alpha

2 years ago

0.11.3

2 years ago

0.11.2

2 years ago

0.11.1-alpha2

2 years ago

0.11.1-alpha

2 years ago

0.11.1

2 years ago

0.10.9

2 years ago

0.10.8

2 years ago

0.10.5

2 years ago

0.10.3

2 years ago

0.10.2

2 years ago

0.10.1

2 years ago