https://github.com/oeo/imgur-clone
minimal file sharing service with short urls
https://github.com/oeo/imgur-clone
Last synced: about 2 months ago
JSON representation
minimal file sharing service with short urls
- Host: GitHub
- URL: https://github.com/oeo/imgur-clone
- Owner: oeo
- Created: 2024-12-02T07:36:52.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-12-02T08:46:36.000Z (6 months ago)
- Last Synced: 2025-02-06T22:42:58.182Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# imgur-clone
minimal file sharing service with short urls
## install
ensure mongodb, memcached, and redis are installed and running somewhere.
```bash
# install dependencies
npm install
```## environment
create `.env` file:
```env
# required
MONGO_URI=mongodb://localhost:27017/imgur-clone
MEMCACHED_URL=localhost:11211
REDIS_URL=redis://localhost:6379# optional
PORT=3000 # default: 3000
ADMIN_TOKEN=your-token # for /admin/stats
CLOAK_ROBOTS=true # hide from search engines
```## run
```bash
node server.js
```## api
- `GET /` - upload page
- `POST /upload` - upload file
- `GET /:shortcode` - view file
- `GET /admin/stats` - view stats (requires auth)
- `?days=7` - number of days (default: 7)
- `?merged=1` - merge stats into totals