Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coffeeeatnight/milkyteadrop_fileserver
Milkyteadrop Fileserver: A flexible and efficient file server in Go, designed for handling and storing various file types, including images and text. Features a RESTful API for file creation and retrieval, ensuring seamless integration with other services and applications.
https://github.com/coffeeeatnight/milkyteadrop_fileserver
Last synced: 29 days ago
JSON representation
Milkyteadrop Fileserver: A flexible and efficient file server in Go, designed for handling and storing various file types, including images and text. Features a RESTful API for file creation and retrieval, ensuring seamless integration with other services and applications.
- Host: GitHub
- URL: https://github.com/coffeeeatnight/milkyteadrop_fileserver
- Owner: CoffeeeAtNight
- Created: 2024-01-26T17:34:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-29T08:36:58.000Z (11 months ago)
- Last Synced: 2024-11-09T08:12:43.994Z (3 months ago)
- Language: Go
- Homepage:
- Size: 7.61 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Milkyteadrop Fileserver
Milkyteadrop Fileserver is a robust and efficient file server built in Go. It is designed to handle and store a variety of file types, including images and text, and offers a RESTful API for easy file creation and retrieval. This makes it an ideal solution for integrating with other services and applications that require a reliable file management system.
## Features
- **File Handling**: Supports different file types including images and text.
- **RESTful API**: Provides endpoints for file creation and retrieval.
- **Base64 Encoding**: Handles base64 encoded data for image files.
- **File Existence Check**: Verifies if a file already exists before creation to prevent duplicates.## Getting Started
### Prerequisites
- Go **1.21.5**
### Installation
1. Clone the repository to your local machine:
git clone https://github.com/CoffeeeAtNight/MilkyTeadrop_FileServer2. Navigate to the project directory:
cd milkyteadrop-fileserver3. Compile and run the server:
go build
sudo ./milkyteadrop-fileserver## API Endpoints
### Create File
- **POST** `/api/v1/create/file`
- **Request Body**:
{
"filename": "example.png",
"filetype": "image",
"fileContent": "base64_encoded_data"
}
- **Response**:
- `200 OK` on success:
{
"status": 200,
"message": "Successfully created file",
"body": "example.png"
}
- `400 Bad Request` on invalid input.
- `500 Internal Server Error` on server error.### Retrieve File
- **GET** `/api/v1/file/[filename]`
- Retrieves the specified file if it exists.
- **Response**:
- File content in the specified format on success.
- `404 Not Found` if the file does not exist.## Configuration
The file server uses a default root path defined as `/usr/local/bin/milkyteadrop-fs/`. You can modify this path in the source code to suit your deployment environment.
## Usage
To interact with the file server, use HTTP requests to the provided endpoints. You can use tools like `curl` or Postman, or integrate the API calls into your application.
## Note
THIS FILESERVER IS NOT INTENDED FOR BEING USED IN PRODUCTION ENVIRONMENTS SINCE IT'S EXPOSES ENDPOINTS WHICH ARE NOT SECURE, USE AT OWN RISK. IT'S ONLY A FUN PROJECT OF MINE!