Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alincode/image-sharing-server
https://github.com/alincode/image-sharing-server
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/alincode/image-sharing-server
- Owner: alincode
- Created: 2021-10-13T00:19:40.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-19T14:52:18.000Z (about 3 years ago)
- Last Synced: 2024-11-06T07:27:13.044Z (about 2 months ago)
- Language: JavaScript
- Size: 240 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image sharing server
- For demonstration purposes only.
- The system will reset data every day (or every redeploy), because Heroku does not provide any sort of persistent storage on dynos.## API docs
Visit https://image-sharing-api-server.herokuapp.com/docs/
## Available Scripts
### How to set up development env?
```
npm install
npm run dev```
### How to run test?
```
npm test```
### Test upload file via curl or REST Client
#### curl
```
curl http://localhost:5000/v1/attachments -F 'file=@./test/dog.jpeg' -F 'description=hi image' -H "Authorization: Bearer your_jwt_access_token"
curl https://image-sharing-api-server.herokuapp.com/v1/attachments -F 'file=@./test/dog.jpeg' -F 'description=hi image' -H "Authorization: Bearer your_jwt_access_token"
```#### REST Client
The file **test.http** can be used to make requests if you are using the [VSCode Rest Client extension](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)
## How to deploy to heroku?
```
heroku create image-sharing-api-server
heroku git:remote -a image-sharing-api-server
heroku config:set JWT_SECRET=ooxxooxx
heroku config:set IMAGE_PREFIX_URL=https://image-sharing-api-server.herokuapp.com/uploads/
git push heroku master
```then go to