upload array of two files

This commit is contained in:
gliggy
2021-11-04 14:42:34 -04:00
parent b29d2e3df4
commit c101c669f0
4 changed files with 2636 additions and 2 deletions

51
Dockerfile2 Normal file
View 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
View 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

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}