How to use the @project-sunbird/ext-framework-server/api.frameworkAPI.bootstrap function in @project-sunbird/ext-framework-server

To help you get started, we’ve selected a few @project-sunbird/ext-framework-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Sunbird-Ed / SunbirdEd-portal / src / app / server.js View on Github external
req.session.deviceId = req.params.deviceId
    telemetryHelper.logSessionStart(req)
    req.session.logSession = true
  }
  res.status(200)
  res.end()
})

app.use('/resourcebundles/v1', bodyParser.urlencoded({ extended: false }),
  bodyParser.json({ limit: '50mb' }), require('./helpers/resourceBundles')(express)) // Resource bundles apis

const subApp = express()
subApp.use(bodyParser.json({ limit: '50mb' }))
app.use('/plugin', subApp)

frameworkAPI.bootstrap(frameworkConfig, subApp).then(data => runApp()).catch(error => runApp())

function endSession(request, response, next) {
  delete request.session['roles']
  delete request.session['rootOrgId']
  delete request.session['orgs']
  if (request.session) {
    if (_.get(request, 'session.userId')) { telemetryHelper.logSessionEnd(request) }
    delete request.session.sessionEvents
    delete request.session['deviceId']
  }
  next()
}

if (!process.env.sunbird_environment || !process.env.sunbird_instance) {
  console.error('please set environment variable sunbird_environment, ' +
    'sunbird_instance  start service Eg: sunbird_environment = dev, sunbird_instance = sunbird')

@project-sunbird/ext-framework-server

Extensible framework for sunbird extensions on server side

MIT
Latest version published 7 months ago

Package Health Score

50 / 100
Full package analysis

Popular @project-sunbird/ext-framework-server functions