Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fulcanelly/file-host-rest-api
https://github.com/fulcanelly/file-host-rest-api
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fulcanelly/file-host-rest-api
- Owner: fulcanelly
- Created: 2024-08-07T13:29:11.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-08-07T14:55:13.000Z (5 months ago)
- Last Synced: 2024-08-08T16:33:09.505Z (5 months ago)
- Language: JavaScript
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Requirements
jq, docker, docker-compose, openssl
### How to run
1. Adjust config.js for your needs
2. Configure env file
```
cp .env.example .env
```3. If you changed something in env - you need to update `config/config.json` file for `sequelize-cli`
```
bin/gencfg.sh
```4. Generate secret keys for JWT signing
```
openssl rand -base64 32 > secret/access_token.key
openssl rand -base64 32 > secret/refresh_token.key
```
5. Run docker```
docker-compose -f docker-compose.dev.yml up
```### Example use
#### Upload file
```bash
curl -F "[email protected]" http://localhost:3000/file/upload \
-H "Authorization: Bearer $TOKEN" | jq
```
#### Sign up
```bash
curl -X POST http://localhost:3000/signup \
-H "Content-Type: application/json" \
-d '{"id": "+380939748644", "password": "sensitivepassword"}'
```