Quickstart
How to fast setup and view
Simple Cofigure
import { createConfig } from "shape-rq";
createConfig({
APIs: {
"MyAPI": "api.example.com"
},
debug: true,
lang: "en"
});
APIs – a list of backend servers used in your project.
MyAPI
is the name (key), andexample.com/api/
is the URL of your server.debug – enables or disables error logging in the console.
lang – language for logs; English and Russian are supported.
GET Request
import { httpGet } from "shape-rq";
httpGet<UserType>("MyAPI", "users/")
.then(data => {
console.log(data);
});
Or with async/await
:
import { httpGet } from "shape-rq";
const res = await httpGet<UserType>("MyAPI", "users/");
console.log(res);
2 minutes, and it's works!
Last updated