feat: handle T&C photos and UI photos roll

This commit is contained in:
José Oliveira 2021-08-01 02:46:13 +01:00
parent ff474ee507
commit e729de1410
12 changed files with 428 additions and 73 deletions

View file

@ -22,6 +22,7 @@ const { typeDefs, resolvers } = require('./graphql/schema')
const devMode = require('minimist')(process.argv.slice(2)).dev
const idPhotoCardBasedir = _.get('idPhotoCardDir', options)
const frontCameraBasedir = _.get('frontCameraDir', options)
const operatorDataBasedir = _.get('operatorDataDir', options)
const hostname = options.hostname
if (!hostname) {
@ -87,6 +88,7 @@ app.use(cors({ credentials: true, origin: devMode && 'https://localhost:3001' })
app.use('/id-card-photo', serveStatic(idPhotoCardBasedir, { index: false }))
app.use('/front-camera-photo', serveStatic(frontCameraBasedir, { index: false }))
app.use('/operator-data', serveStatic(operatorDataBasedir, { index: false }))
// Everything not on graphql or api/register is redirected to the front-end
app.get('*', (req, res) => res.sendFile(path.resolve(__dirname, '..', '..', 'public', 'index.html')))