mirror of
https://github.com/SrIzan10/makesweet-api.git
synced 2026-05-01 10:55:14 +00:00
upload array of two files
This commit is contained in:
51
Dockerfile2
Normal file
51
Dockerfile2
Normal file
@@ -0,0 +1,51 @@
|
||||
FROM ubuntu:18.04
|
||||
|
||||
# this is a very chubby docker image, it could be stripped down a lot.
|
||||
|
||||
RUN \
|
||||
apt-get update; \
|
||||
apt-get install -y build-essential
|
||||
|
||||
RUN \
|
||||
apt-get update; \
|
||||
apt-get install -y libgd-dev libzzip-dev libopencv-highgui-dev
|
||||
|
||||
RUN \
|
||||
cd tmp; \
|
||||
apt-get update; \
|
||||
apt-get install -y cmake wget; \
|
||||
wget https://github.com/robotology/yarp/archive/v2.3.72.tar.gz; \
|
||||
tar xzvf v2.3.72.tar.gz; \
|
||||
mkdir yarp; \
|
||||
cd yarp; \
|
||||
cmake -DSKIP_ACE=TRUE ../yarp-*; \
|
||||
make
|
||||
|
||||
RUN \
|
||||
apt-get update; \
|
||||
apt-get install -y protobuf-compiler libprotobuf-dev
|
||||
|
||||
RUN \
|
||||
apt-get update; \
|
||||
apt-get install -y libopencv-videoio-dev
|
||||
|
||||
RUN \
|
||||
apt-get update; \
|
||||
apt-get install -y libjsoncpp-dev
|
||||
|
||||
COPY . /makesweet/
|
||||
|
||||
RUN \
|
||||
cd /makesweet; \
|
||||
mkdir build; \
|
||||
cd build; \
|
||||
cmake -DUSE_OPENCV=ON -DUSE_DETAIL=ON -DYARP_DIR=/tmp/yarp ..; \
|
||||
make VERBOSE=1
|
||||
|
||||
RUN \
|
||||
echo "#!/bin/bash" > /reanimator; \
|
||||
echo "cd /share" >> /reanimator; \
|
||||
echo "/makesweet/build/bin/reanimator \"\$@\"" >> /reanimator; \
|
||||
chmod u+x /reanimator
|
||||
|
||||
ENTRYPOINT ["/reanimator"]
|
||||
19
index.js
Normal file
19
index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const express = require('express')
|
||||
const bodyParser = require('body-parser')
|
||||
const multer = require('multer')
|
||||
const app = express()
|
||||
const port = 3000
|
||||
const upload = multer({ dest: '/tmp/' })
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World!')
|
||||
})
|
||||
|
||||
app.post('/make', upload.single('image'), (req, res) => {
|
||||
res.send('not yet ready\n' + req.file)
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening at http://localhost:${port}`)
|
||||
})
|
||||
|
||||
2561
package-lock.json
generated
2561
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/paulfitz/makesweet#readme",
|
||||
"dependencies": {
|
||||
"express": "^4.17.1"
|
||||
"body-parser": "^1.19.0",
|
||||
"express": "^4.17.1",
|
||||
"multer": "^1.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.13"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user