const log4js = require('log4js')
const { Router } = require('express')
const router = Router()
const myfunc_set = async (req, res) =>{
logger.info('myfunc_set')
try {
const val1 = req.query.val1
req.app.set('value1', val1)
res.send({'value1': val1})
} catch (e){
}
}
const myfunc_get = async (req, res) =>{
logger.info('myfunc_get')
try {
res.send({'value1': req.app.get('value1')})
} catch (e){
}
}
router.route('/value1')
.get(myfunc_get)
.post(myfunc_set)