- Tiny (build folder 42kb) ✅
- DynamoDB with AWS SDK as database provider (no configuration) ✅
- Create (same api for update) short URL ✅
- Delete short URL ✅
- Swagger documentation (/links/docs) ✅
- Clustering mode (for high traffic) ✅
- Redirects ✅
- Loggin with morgan ✅
- Caching for redirects on memory with custom TTL ✅
- Rate limit on apis ✅
- Error handling ✅
- Compression response with gzip ✅
- nanoID generator ✅
cp .env.example .env
Edit .env with yours following variables:
PORT - port to listen on
BASE_URL - base url for shortener service
AWS_REGION - AWS region
LINKS_TABLE_NAME - DynamoDB table name for links
CACHE_TTL - cache TTL for redirects in seconds (default: 60)
To use DynamoDB on you machine you need to install AWS SDK and configure it:
npm install -g aws-sdk
aws configure
and set your region and credentials.
git clone https://github.com/jacopobonomi/shorten
cd shorten
yarn install
yarn start
git clone https://github.com/jacopobonomi/shorten
cd shorten
yarn install
yarn start:dev
git clone https://github.com/jacopobonomi/shorten
cd shorten
yarn install
yarn start:cluster
Use Nginx to manage reverse proxy, certficate and custom domain. And use pm2 to start cluster mode.
pm2 start -1 <NODES_NUMBER> yarn start:
- Authentication with API Key for POST/DELETE/PUT
- Add readble slug for short URL optional parameter
- Add domain on model, to manage multiple domains
- Manage wrapper to run on Lambda AWS
- Add analytics for short URL
- Add auto exctract short slug from redirect url
- Add another provider for database (Redis, MongoDB, Firebase(?))>
- GUI (SolidJS)?