Static serve the image folder even when empty
This commit is contained in:
parent
d3478fb2ba
commit
9a43bc4417
1 changed files with 5 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ const helmet = require('helmet')
|
||||||
const WebSocket = require('ws')
|
const WebSocket = require('ws')
|
||||||
const http = require('http')
|
const http = require('http')
|
||||||
const SocketIo = require('socket.io')
|
const SocketIo = require('socket.io')
|
||||||
|
const makeDir = require('make-dir')
|
||||||
const _ = require('lodash/fp')
|
const _ = require('lodash/fp')
|
||||||
|
|
||||||
const machineLoader = require('../machine-loader')
|
const machineLoader = require('../machine-loader')
|
||||||
|
|
@ -250,10 +251,12 @@ const certOptions = {
|
||||||
|
|
||||||
app.use(serveStatic(path.resolve(__dirname, '..', '..', 'public')))
|
app.use(serveStatic(path.resolve(__dirname, '..', '..', 'public')))
|
||||||
|
|
||||||
if (fs.existsSync(idPhotoCardBasedir)) {
|
if (!fs.existsSync(idPhotoCardBasedir)) {
|
||||||
app.use('/id-card-photo', serveStatic(idPhotoCardBasedir, {index: false}))
|
makeDir.sync(idPhotoCardBasedir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.use('/id-card-photo', serveStatic(idPhotoCardBasedir, {index: false}))
|
||||||
|
|
||||||
function register (req, res, next) {
|
function register (req, res, next) {
|
||||||
const otp = req.query.otp
|
const otp = req.query.otp
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue