https://github.com/ubermanu/sol
☀️ Small SOLID server implementation
https://github.com/ubermanu/sol
bun server solid
Last synced: about 2 months ago
JSON representation
☀️ Small SOLID server implementation
- Host: GitHub
- URL: https://github.com/ubermanu/sol
- Owner: ubermanu
- License: mit
- Created: 2022-09-06T20:52:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-24T16:16:00.000Z (over 3 years ago)
- Last Synced: 2025-04-07T02:42:49.392Z (about 1 year ago)
- Topics: bun, server, solid
- Language: TypeScript
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SOL
This project is a simple implementation of a SOLID server.
It has the basic endpoints to create, fetch, update and delete resources.
## Usage
Run the server with [Bun](https://bun.sh):
bun run start
### PUT
Creates a new resource for the given URL.
curl -X PUT -H "Content-Type: text/plain" \
-d 'Hello world!' \
http://localhost:8000/myfile.txt
### POST
Creates a new resource and generates a random URL.
curl -X POST -H "Content-Type: text/plain" \
-d 'Hello world!' \
http://localhost:8000/
> The response's `Location` header will contain the URL of the created resource.
### GET
Fetches the resource for the given URL.
curl -H "Accept: text/plain" \
http://localhost:8000/myfile.txt
### DELETE
Deletes the resource for the given URL.
curl -X DELETE http://localhost:8000/myfile.txt
## Configuration
Copy the `.env.dist` file to `.env` and fill in the values.
### Storage
The storage can be configured to use either files or a database.
See the [.env.dist](.env.dist) file for more information.