Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet(
// !code: helmet_config // !end
));
app.use(cors(
// !code: cors_config // !end
));
app.use(compress(
// !code: compress_config // !end
));
app.use(express.json(
// !code: json_config // !end
));
app.use(express.urlencoded(
// ! code: urlencoded_config
{ extended: true }
// !end
));
// ! code: use_favicon
// Use favicon
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// !end
// ! code: use_static
// Host the public folder
app.use('/', express.static(app.get('public')));
// !end
// !code: use_end // !end
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet(
// !code: helmet_config // !end
));
app.use(cors(
// !code: cors_config // !end
));
app.use(compress(
// !code: compress_config // !end
));
app.use(express.json(
// !code: json_config // !end
));
app.use(express.urlencoded(
// ! code: urlencoded_config
{ extended: true }
// !end
));
// ! code: use_favicon
// Use favicon
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// !end
// ! code: use_static
// Host the public folder
app.use('/', express.static(app.get('public')));
// !end
// !code: use_end // !end
// !code: init // !end
const app = express(feathers());
// !code: use_start // !end
// Load app configuration
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet());
app.use(cors());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));
// !code: use_end // !end
// Set up Plugins and providers
// !code: config_start // !end
app.configure(express.rest());
app.configure(socketio());
// Configure other middleware (see `middleware/index.ts`)
app.configure(middleware);
// Configure authentication (see `authentication.ts`)
app.configure(authentication);
// !code: init // !end
const app = express(feathers());
// !code: use_start // !end
// Load app configuration
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet());
app.use(cors());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));
// !code: use_end // !end
// Set up Plugins and providers
// !code: config_start // !end
app.configure(express.rest());
app.configure(socketio());
// Configure database adapters
app.configure(sequelize);
// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet(
// !code: helmet_config // !end
));
app.use(cors(
// !code: cors_config // !end
));
app.use(compress(
// !code: compress_config // !end
));
app.use(express.json(
// !code: json_config // !end
));
app.use(express.urlencoded(
// ! code: urlencoded_config
{ extended: true }
// !end
));
// ! code: use_favicon
// Use favicon
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// !end
// ! code: use_static
// Host the public folder
app.use('/', express.static(app.get('public')));
// !end
// !code: use_end // !end
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet(
// !code: helmet_config // !end
));
app.use(cors(
// !code: cors_config // !end
));
app.use(compress(
// !code: compress_config // !end
));
app.use(express.json(
// !code: json_config // !end
));
app.use(express.urlencoded(
// ! code: urlencoded_config
{ extended: true }
// !end
));
// ! code: use_favicon
// Use favicon
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// !end
// ! code: use_static
// Host the public folder
app.use('/', express.static(app.get('public')));
// !end
// !code: use_end // !end
// Set up Plugins and providers
// !code: config_start // !end
default: 2,
max: 4
},
esVersion: db.getApiVersion(),
elasticsearch: db.getServiceConfig('todos')
});
// Create a feathers instance.
let app = express(feathers())
.configure(rest())
// Enable Socket.io services
.configure(socketio())
// Turn on JSON parser for REST services
.use(express.json())
// Turn on URL-encoded parser for REST services
.use(express.urlencoded({ extended: true }))
.use('/todos', todoService);
module.exports = app;
const app = express(feathers());
// !code: use_start // !end
// Load app configuration
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet());
app.use(cors());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));
// !code: use_end // !end
// Set up Plugins and providers
// !code: config_start // !end
app.configure(express.rest());
app.configure(socketio());
// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
// Set up our services (see `services/index.js`)
app.configure(services);
// Set up event channels (see channels.js)
const app = express(feathers());
// !code: use_start // !end
// Load app configuration
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));
// !code: use_end // !end
// Set up Plugins and providers
// !code: config_start // !end
app.configure(express.rest());
app.configure(socketio());
// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
// Set up our services (see `services/index.js`)
app.configure(services);
// Set up event channels (see channels.js)
// !end
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet(
// !code: helmet_config // !end
));
app.use(cors(
// !code: cors_config // !end
));
app.use(compress(
// !code: compress_config // !end
));
app.use(express.json(
// !code: json_config // !end
));
app.use(express.urlencoded(
// ! code: urlencoded_config
{ extended: true }
// !end
));
// ! code: use_favicon
// Use favicon
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// !end
// ! code: use_static
// Host the public folder
app.use('/', express.static(app.get('public')));
// !end
// !code: use_end // !end
// Set up Plugins and providers
// !code: config_start // !end