-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (31 loc) · 991 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var Minio = require('minio')
const express = require('express')
const app = express()
const port = 3000
require('dotenv').config()
var minioClient = new Minio.Client({
endPoint: 'localhost',
port: 9000,
useSSL: true,
accessKey: process.env.ACCESS_KEY,
secretKey: process.env.SECRET_KEY
});
runtest();
function runtest() {
var file = './ex/v16.png';
console.log(file)
minioClient.fPutObject("");
}
app.get('/', (req, res) => res.sendFile('./home/index.html', { root: __dirname }));
app.get('/script.js', (req, res) => res.sendFile('./home/script.js', { root: __dirname }));
app.post('/fileupload', (req, res) => {
console.log(req.body);
// req.
// minioClient.fPutObject("");
// minioClient.listBuckets(function(err, buckets) {
// if (err) return console.log(err)
// console.log('buckets :', buckets)
// res.send(buckets)
// })
});
app.listen(port, () => console.log(`Example app listening on port ${port}!`))