https://github.com/donuts-are-good/shorty
link shortener
https://github.com/donuts-are-good/shorty
go golang hacktoberfest link-shortener wip
Last synced: 3 months ago
JSON representation
link shortener
- Host: GitHub
- URL: https://github.com/donuts-are-good/shorty
- Owner: donuts-are-good
- License: mit
- Created: 2023-08-12T18:38:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-15T02:48:59.000Z (about 1 year ago)
- Last Synced: 2025-08-31T03:45:42.513Z (3 months ago)
- Topics: go, golang, hacktoberfest, link-shortener, wip
- Language: Go
- Homepage:
- Size: 89.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Shorty
Shorty is a simple and efficient URL shortener written in Go. It provides an easy way to create short, memorable links for long URLs.

## Features
- Create short URLs for long links
- Redirect short URLs to their original long URLs
- View statistics for link usage
- Simple web interface
- SQLite database for storing URL mappings
- Configurable via JSON file
## Installation
1. Clone the repository:
```
git clone https://github.com/donuts-are-good/shorty.git
```
2. Navigate to the project directory:
```
cd shorty
```
3. Build the project:
```
go build
```
## Configuration
Shorty uses a JSON configuration file named `shorty.config`. You can modify this file to change the database name, server port, routes, and short URL settings.
Example configuration:
```json
{
"database": {
"name": "./url_mapping.db"
},
"server": {
"port": ":9130"
},
"routes": {
"index": "/",
"create": "/create",
"redirect": "/_/"
},
"shortURL": {
"length": 8,
"charset": "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
}
}
```
## Usage
To run Shorty:
```
./shorty
```
The server will start on the port specified in the configuration file (default is 9130).
## Running with appserve
[appserve](https://github.com/donuts-are-good/appserve) is a reverse proxy server with automatic HTTPS. To run Shorty with appserve:
1. Install appserve:
```
git clone https://github.com/donuts-are-good/appserve.git
cd appserve
go build
```
2. Start appserve:
```
./appserve
```
3. In the appserve interactive shell, add a route for Shorty:
```
add yourdomain.com 9130
```
Replace `yourdomain.com` with your actual domain and `9130` with the port Shorty is running on.
4. Start Shorty as described in the Usage section.
Now, appserve will handle HTTPS and route requests to Shorty.
## License
Shorty is released under the MIT License. See the [LICENSE](LICENSE) file for details.
## Live Instance
A running instance of Shorty is available at [https://goby.lol](https://goby.lol).