cprox

Version, currently master branch1 version
  • master branchlatestMay 1, 2020

github.com/arschles/cprox

A basic HTTP proxy & url shortener written in Crystal

6 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  cprox:
    github: arschles/cprox
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.33.0
License
MIT
Author
Aaron Schlesinger <aaron@ecomaz.net>
Target
  • cprox from src/cprox.cr

Dependencies

Runtime Dependencies

  • kemal*github: kemalcr/kemal
  • nuummite~> 0.1.4github: codesteak/nuummite
  • spec-kemal*github: kemalcr/spec-kemal

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
```