Simple, open-source, self-hostable
MIT license, 0 lock-in and built with ❤️ by Borrow
Follow this guide to authenticate if using our managed service.
Read the full documentation for Borrow.
Measure the latency of your API around the world in 1 command.
cargo install borrow-dev
export BORROW_API_KEY=your_borrow_api_key
borrow ms https://api.example.com/data \
-m POST \
--header "Authorization: Bearer token" \
--header "Content-Type: application/json" \
-d '{"key": "value"}'Self-hostable rate limiting API for protecting regular service usage.
Let's use the fixed window algorithm to rate limit our login endpoint to 10 requests per minute.
import { limiter } from "@borrowdev/limiter";
const { success, timeLeft } = await limiter(
{
key: "my-limiter-id",
userId: "current-user-id",
},
{
limiters: [
{
maxRequests: 10,
interval: "minute",
type: "fixed",
},
],
},
);
if (!success) {
return {
message:
"Rate limit exceeded." + timeLeft !== null
? ` You can try again in ${timeLeft} seconds.`
: "",
};
}To self-host the Limiter API, follow the self-hosting guide.
cargo install borrow-devBorrow Start is a command-line tool that helps you quickly set up common boilerplate code with pre-defined templates and placeholders.
Templates are downloaded from the Borrow registry, or you can create your own templates
and refer to them locally by using the local: prefix before <template>.
# Download and install a template
borrow start new -t <template> -o <output_dir>
# Delete a template from the cache
borrow start del -t <template>borrow start new -t supabase-proxy -o ~/my-awesome-project- Add support for self-hosted GitHub templates.
- Add support for package metadata.
- Add support for sandboxed template code execution with hooks.
- Add support for per-file config with frontmatter.
- Write documentation for how to create your own templates.
