Skip to content

ashleyhindle/lech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snazzy URL shortening - lech

lech-logo

Requirements

  • PHP 8.2
  • NPM
  • Composer
  • Herd (ideally)

Getting setup

We use sqlite locally for local development ease.

Setup instructions

cp .env.example .env
composer install
./artisan migrate

npm install
npm run build
composer run dev

It's best to use herd to link this project so it's available at https://lech.test, but you can also just run php artisan serve and visit http://localhost:8000.

herd link
herd secure
open "https://lech.test"

API

Test API token is lech_E64ujZycu1lDYIeO3jeIeTff0Jz0pH5lqFWbUzR97caaca42.

You can use the openapi.yaml file to see the full API spec.

Encoding

curl "https://lech.test/api/encode" -H "X-Api-Token: <token>" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"url": "https://www.google.com"}'

Decoding

curl "https://lech.test/api/decode" -H "X-Api-Token: <token>" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"url": "https://lech.test/123456"}'