I'm using the express template but I'm using express-jwt as well. The problem is that I cannot take the secrets from the context because I'm trying to protect all the app, so I'm loading a config.json file that I'm ignoring from my .gitignore file but I need it in the webtask. I could use the .npmignore to allow use the config.json in the webtask. There is any chance to support this? or another way to do it?
import express from 'express'
import Webtask from 'webtask-tools'
import bodyParser from 'body-parser'
import jwt from 'express-jwt'
import config from './config.json' // This file is ignore by .gitignore but allow by .npmignore
import items from './routes/items'
const app = express()
app.use(bodyParser.json())
app.use(jwt({
secret: config.AUTH0_CLIENT_SECRET,
audience: config.AUTH0_CLIENT_ID,
issuer: `https://${config.AUTH0_DOMAIN}/`
}))
// Routes
items(app)
module.exports = Webtask.fromExpress(app)
I'm using the express template but I'm using
express-jwt
as well. The problem is that I cannot take the secrets from the context because I'm trying to protect all the app, so I'm loading aconfig.json
file that I'm ignoring from my.gitignore
file but I need it in the webtask. I could use the.npmignore
to allow use theconfig.json
in the webtask. There is any chance to support this? or another way to do it?