A powerful library to create your own API with ease.
- 🚀 Optimized and advanced codes and functions.
- 📝 Easy to learn.
- 📚 Constant updates.
- 🔥 Image manipulation.
npm i easy-api.ts
Check documentation here and join our support server.
const { API } = require('easy-api.ts');
const api = new API({
dots: false,
reverse: false
});
// Lets load our endpoints...
api.load('./routes')
console.log('Source loaded.') // API#load isn't async anymore.
api.connect({ port: 4500 }) // Now we're starting the API because the source is ready.
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"
}]
]
$ignore[Now we're breaking it to stop executing the left code.]
$break
]
$createCanvas[
$setDimentions[512;512]
$color[$query[hex]]
$drawRect[0;0;512;512]
]
$reply[
$setCode[200]
$setType[canvas]
$setBody[%default%]
]
`
};
Click to read LICENSE
By using "easy-api.ts" you agree to the license terms and all conditions and consequences of not following these guidelines.
The complete code of "easy-api.ts" is copyrighted, and any unauthorized distribution of the code will be removed immediately.
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.
We shall be excluded from any liability for damages or problems arising from the use of the code.
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