|
@@ -6,7 +6,8 @@ const express_graphql = require('express-graphql');
|
|
|
const { buildSchema, printSchema } = require('graphql');
|
|
|
const expand = require('mm-graphql/expand')
|
|
|
const fs = require('fs')
|
|
|
-const upload = require('multer')({ dest: `${__dirname}/public/images` })
|
|
|
+const uploadPath = `${__dirname}/public/images/`;
|
|
|
+const upload = require('multer')({ dest: uploadPath })
|
|
|
|
|
|
|
|
|
;(async () => {
|
|
@@ -147,7 +148,6 @@ const upload = require('multer')({ dest: `${__dirname}/public/images` })
|
|
|
app.use('/graphql', express_graphql(jwtGQL({anonSchema, anonResolvers, schema, createContext: getModels, graphiql: true, secret: jwtSecret})))
|
|
|
|
|
|
|
|
|
- const uploadPath = `${__dirname}/public/images/`;
|
|
|
app.post('/upload', upload.single('photo'), async (req, res, next) => {
|
|
|
let decoded;
|
|
|
if (decoded = jwtCheck(req, jwtSecret)){
|