https://github.com/firmanjs/minio-demo
https://github.com/firmanjs/minio-demo
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/firmanjs/minio-demo
- Owner: firmanJS
- Created: 2023-09-14T09:41:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-26T11:29:56.000Z (over 2 years ago)
- Last Synced: 2025-04-09T17:07:18.030Z (about 1 year ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Minio Demo
Simple minio demo using aws s3 style and package
## How To Run
```sh
# copy environment variable
cp .env.sample .env
# build minio with docker compose
docker-compose -f minio.yml up --build
```
### Minio Setup
After completing the Minio build, open it in the browser and log in to the Minio console.
Open with your favorite browser like Chrome or Mozilla
* [Minio Console](http://localhost:9001)
login with username and password your setup in env:
```txt
username: minio // adjust it to the env you setup
password: minio1234 // adjust it to the env you setup
```
### Create New Bucket
Follow steps below:
1. Click `Bucket` tab and click create bucket button in right side :
* Name = `belajar`
2. Toogle versioning info you want versioning the bucket
3. Create bucket tab then click bucket which was made earlier
4. Set Bucket Access policy, click the bucket name `belajar` in summary tab set access policy set the public for example case

### Create Access Keys
Follow steps below:
1. Click on `Access Keys` in the left menu for create an access key to your bucket storage then click `Create access key` button.
2. You will see that the default Access key and Secret key are generated then click created
3. You will copy Access key and Secret key or download for backup, if your forgotten
dont forget fill the env
```sh
AWS_ACCESS=
AWS_SECRET=
```
4. After created go back to list and click detail
5. And add rule like this you can copy in file policy.example.json, dont forget rename to your bucket definition

Now you have successfully finished the minio configuration. You can do testing using postman at this URL
```bash
# via postman
[POST] http://localhost:1000/save-to-minio
body form data image
# via curl
curl --location 'http://localhost:1000/save-to-minio' \
--form 'image=@"/path"'
```