Feat: refactor routes.js express entrypoint config
Feat: express config script refactor Feat: add state and settingsCache files
This commit is contained in:
parent
c3f8f98c26
commit
85235eaa13
22 changed files with 807 additions and 1 deletions
12
lib/middlewares/ca.js
Normal file
12
lib/middlewares/ca.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const pairing = require('../pairing')
|
||||
|
||||
function ca (req, res) {
|
||||
console.log("ca")
|
||||
const token = req.query.token
|
||||
|
||||
return pairing.authorizeCaDownload(token)
|
||||
.then(ca => res.json({ ca }))
|
||||
.catch(() => res.status(403).json({ error: 'forbidden' }))
|
||||
}
|
||||
|
||||
module.exports = ca
|
||||
Loading…
Add table
Add a link
Reference in a new issue