Browse Source

logging

master
Rich Brown 1 year ago
parent
commit
91f92fc037
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      routes/createRouter.js

+ 5
- 1
routes/createRouter.js View File

@@ -9,6 +9,7 @@ const createRouter = express.Router();

createRouter.post('/form', upload.single('file'), (req, res) => {
const { file, body: { title, body, arrayOfTags } } = req.body;
console.log(file, body, title, arrayOfTags);
return req.app.locals.mp
.create(
{
@@ -21,7 +22,10 @@ createRouter.post('/form', upload.single('file'), (req, res) => {
'multipart',
)
.then(url => res.json({ error: null, url }))
.catch(() => res.status(400).json({ error: 'micropub-helper failed; multipart', url: null }));
.catch((err) => {
console.log(err);
res.status(400).json({ error: 'micropub-helper failed; multipart', url: null });
});
});

createRouter.post('/', (req, res) => {


Loading…
Cancel
Save