https://github.com/arschles/cprox
A basic HTTP proxy & url shortener written in Crystal
https://github.com/arschles/cprox
crystal crystal-lang crystal-language
Last synced: 8 months ago
JSON representation
A basic HTTP proxy & url shortener written in Crystal
- Host: GitHub
- URL: https://github.com/arschles/cprox
- Owner: arschles
- License: mit
- Created: 2020-04-02T22:23:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-01T19:34:02.000Z (almost 6 years ago)
- Last Synced: 2025-05-12T22:55:23.292Z (11 months ago)
- Topics: crystal, crystal-lang, crystal-language
- Language: Crystal
- Size: 17.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cprox
A basic HTTP proxy and url shortener written in [Crystal](https://crystal-lang.org).
## Proxy API
### `GET /forward/:code`
Forwards to the URL that was registered with `:code`
### `POST /code/:code`
Register the URL `:url` with a given code. The code should be specified in the `POST` body with JSON:
```json
{
"url": "some URL here"
}
```
### `DELETE /code/:code`
Delete the given `:code` from the registry.
## Installation and development
All you need is the Crystal toolchain to build and run this project. Go [here](https://crystal-lang.org/install/) to learn how to install the toolchain.
When you have it installed, pull down the dependencies:
```console
$ shards install
```
When that's done, run the app:
```console
$ crystal run
```