old_contents: const express = require('express');
  
  const HealthcheckRouter = require('./routers/HealthcheckRouter');
  const SchemasRouter = require('./routers/SchemasRouter');
  const StatusRouter = require('./routers/StatusRouter');
  const FunctionsRouter = require('./routers/FunctionsRouter');
  
  
  const morgan = require('morgan');
  
  
  const RedisStorage = require('../domain/storage/redis');
  const SchemaResponse = require('./SchemaResponse');
  const Sandbox = require('../domain/sandbox').Sandbox;
  
  const app = express();
  
  app.use(morgan('tiny'));
  app.disable('x-powered-by');
  
  app.set('memoryStorage', new RedisStorage());
  app.set('sandbox', new Sandbox());
  
  app.get('/', (req, res) => {
    new SchemaResponse(req, res, 'root')
      .json({
        name: 'Backstage functions',
      });
  });
  
  app.use('/healthcheck', HealthcheckRouter);
  app.use('/status', StatusRouter);
  app.use('/_schemas', SchemasRouter);
  app.use('/functions', FunctionsRouter);
  
  
  module.exports = app;
  
new_contents: const express = require('express');
  
  const HealthcheckRouter = require('./routers/HealthcheckRouter');
  const SchemasRouter = require('./routers/SchemasRouter');
  const StatusRouter = require('./routers/StatusRouter');
  const FunctionsRouter = require('./routers/FunctionsRouter');
  
  
  const morgan = require('morgan');
  
  
  const RedisStorage = require('../domain/storage/redis');
  const SchemaResponse = require('./SchemaResponse');
  const Sandbox = require('../domain/sandbox').Sandbox;
  
  const app = express();
  
  app.use(morgan('tiny'));
  app.disable('x-powered-by');
  app.enable('trust proxy');
  
  app.set('memoryStorage', new RedisStorage());
  app.set('sandbox', new Sandbox());
  
  app.get('/', (req, res) => {
    new SchemaResponse(req, res, 'root')
      .json({
        name: 'Backstage functions',
      });
  });
  
  app.use('/healthcheck', HealthcheckRouter);
  app.use('/status', StatusRouter);
  app.use('/_schemas', SchemasRouter);
  app.use('/functions', FunctionsRouter);
  
  
  module.exports = app;
  
subject: Enable trust proxy property: https://expressjs.com/en/guide/behind-proxies.html