A secure image hosting server with user authentication and a modern web interface.
- User Authentication - Token-based authentication for secure uploads
- Web Interface - Beautiful dashboard to manage your images
- Multiple Formats - Upload and convert images to JPG, PNG, or WebP
- Auto Format Detection - Access images without specifying file extension
- Image Management - View, download, and delete your uploaded images
- API Access - Full REST API for integration with other apps
- Install dependencies:
npm install express multer sharp- Start the server:
node server.js- Login - Sign in with your username and password
- Generate Token - Create an API token in the Dashboard
- Upload Images - Drag and drop or click to select images
- View Gallery - Browse and manage all your uploaded images
POST /upload
Body (multipart/form-data):
- image: image file
- token: your API token
- format: jpg/png/webp (optional, converts image format)
Response:
{
"success": true,
"data": {
"filename": "1_7"
}
}
GET /image/:filename
Example: /image/1_7
(Automatically serves the correct format - jpg, png, or webp)
DELETE /delete_image
Body (JSON):
- token: your API token
- filename: filename
Response:
{
"success": true,
"data": {
"message": "Image deleted successfully"
}
}
POST /create_user
Body (JSON):
- admin_password: admin password
- username: new username
- password: new password
Response:
{
"success": true,
"data": {
"message": "User created successfully",
"username": "newuser",
"token": "new-token"
}
}
Images are saved as: {userid}_{imageid}.{format}
- Example:
1_7.jpg(user 1, image 7)
Access images by name only: /image/1_7 (no extension needed!)
- Express.js - Web server
- Multer - File upload handling
- Sharp - Image processing and format conversion
- SQLite - User and token database (via database.js)
See LICENSE file for details.