https://github.com/iron-m4n/megacdn
A lightweight and serverless CDN utilizing MEGA for file storage and delivery.
https://github.com/iron-m4n/megacdn
api cdn fastify mega megajs
Last synced: 4 months ago
JSON representation
A lightweight and serverless CDN utilizing MEGA for file storage and delivery.
- Host: GitHub
- URL: https://github.com/iron-m4n/megacdn
- Owner: IRON-M4N
- Created: 2025-02-22T11:22:23.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-22T11:30:47.000Z (4 months ago)
- Last Synced: 2025-02-22T12:25:29.956Z (4 months ago)
- Topics: api, cdn, fastify, mega, megajs
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MegaCDN
A lightweight and serverless CDN utilizing MEGA for file storage and delivery.## Installation
### Clone the Repository
```sh
git clone https://github.com/IRON-M4N/MegaCDN.git
cd MegaCDN
npm install
```## Configuration
Modify `config.js` or use environment variables. Example `.env` file:
```
[email protected]
PASS=Katarenai nemurenai toroimerai
DOMAIN=https://cdn.ironman.my.id
TEMP=memory
```## Running the Server
Using PM2 for process management:
```sh
npm start
```
To stop or restart:
```sh
npm stop
npm restart
```## Uploading Files
Send a `POST` request to `/upload` with a multipart form containing a file.
Example using `curl`:
```sh
curl -X POST -F "[email protected]" http://yourdomain.com/upload
```### Response Example
```json
{
"success": true,
"files": [
{
"url": "https://yourdomain.com/media/blahblahblah",
"size": 6969
}
]
}
```## To-Do
- [ ] Add multiple accounts support
- [ ] Add an web interface (optional)## Contributing
1. Fork the repository
2. Create a new branch (`feature-web`)
3. Commit your changes
4. Open a pull request© [IRON-M4N](https://github.com/IRON-M4N)