Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xmarcos/enchinito-api

A useless API for @xmarcos/enchinito using Cloudflare Workers.
https://github.com/xmarcos/enchinito-api

cloudflare cloudflare-workers enchinito meme

Last synced: 2 months ago
JSON representation

A useless API for @xmarcos/enchinito using Cloudflare Workers.

Awesome Lists containing this project

README

        

# enchinito API

A useless API for [@xmarcos/enchinito](https://github.com/xmarcos/enchinito) using [Cloudflare Workers](https://workers.cloudflare.com/).

## Usage

```bash
curl -s "https://enchinito-api.xmarcos.workers.dev/enchinito/Sudo%20make%20me%20a%20sandwich" | jq .
# {
# "input": "Sudo make me a sandwich",
# "output": "Sidi miki mi i sindwich",
# "version": "0.1.0"
# }
```

You can also get the response in `text/plain` or `application/xml`.

```bash
# pipe-friendly text
curl -s "https://enchinito-api.xmarcos.workers.dev/enchinito/Sudo%20make%20me%20a%20sandwich" -H "Accept: text/plain" | rev
# hciwdnis i im ikim idiS

# verbose xml, if you are into that
# brew install python-yq
curl -s "https://enchinito-api.xmarcos.workers.dev/enchinito/Sudo%20make%20me%20a%20sandwich" -H "Accept: application/xml" | xq
#
# Sudo make me a sandwich
# Sidi miki mi i sindwich
# 0.1.0
#
```

## Setup

```bash
# needs node v16+
npm install -g wrangler
npm install
```

## Development

```bash
wrangler dev
# 🤞
```

> [Conventional Commits](https://www.conventionalcommits.org/en/about/) are enforced using a hook but there is no `prepare-commit-msg` _wizard_. You can do `npm run commit` if you need that.

## Deploy

```bash
wrangler publish
# tail prod logs
wrangler tail
```

## But why?