Create an API
Create an API with Barktler is very simple. This document will help you get to know about creating a simple API with Barktler.
Install
Make sure the Barktler package is installed.
For install, run the following command under your project folder to install the required dependencies.
bash <(curl -s https://barktler.com/quick-start/create-an-api/install-core.sh)
First API
Let’s write a simple API with allow us to get the webpage of Google search result.
Google provides a simple URL for searching. For example, the URL of the search keyword hello
will be: https://www.google.com/search?q=hello
.
The TypeScript
code for the described API will look like this.
And that’s it, your API is ready, and the various features of that class is ready to ship!
Timeout
Timeout is supported by Barktler, see Timeout for more details.
Config
API created by Barktler is multi-dimension configurable, see Runtime Config.
Next
See Execute API for how to use your created API.