Skip to content

Yedidyar/backend-rebase

Repository files navigation

Blob Server

Prerequisites

  • pnpm
  • node v23+

Running the project

When running for the first time:

chmod +x start-services.sh

Start the server with:

pnpm malic:up

Configuration

The server can be configured through the config.ts file. Here are the default settings:

  • BLOBS_DIR: "storage" - Directory for storing blob data
  • METADATA_DIR: "metadata" - Directory for storing blob metadata
  • MAX_LENGTH: 10MB - Maximum size of a single blob
  • MAX_DISK_QUOTA: 1GB - Maximum total storage space
  • MAX_HEADER_LENGTH: 100 - Maximum length of a single header
  • MAX_HEADER_COUNT: 20 - Maximum number of headers per blob
  • MAX_ID_LENGTH: 200 - Maximum length of blob IDs
  • MAX_BLOBS_IN_FOLDER: 1 - Maximum number of blobs per folder

load balancer will start on port 3000 by default.

API Endpoints

internal enpoints for load balancer management

POST /internal/nodes
 - register a node to the load balancer
GET /internal/nodes
 - get data of nodes registered to the load balancer

Store a Blob

POST /blobs/:id
Content-Type: application/octet-stream

<binary data>

Retrieve a Blob

GET /blobs/:id

Delete a Blob

DELETE /blobs/:id

Response Codes

  • 200 OK: Request successful
  • 201 Created: Blob successfully created
  • 400 Bad Request: Invalid request parameters
  • 404 Not Found: Blob not found
  • 413 Payload Too Large: Blob exceeds size limits
  • 500 Internal Server Error: Server error

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •