How to use @ui5/server - 3 common examples

To help you get started, we’ve selected a few @ui5/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 SAP / openui5 / grunt / config / connect.js View on Github external
var fs = require('fs');
var url = require('url');
var cspMiddleware = require('@ui5/server').middleware.csp;


module.exports = function(grunt, config) {

	// determine the testsuite name and lookup the sap.ui.core library
	// to be a bit more dynamic for the livereload middleware
	var testsuiteName = config.testsuite && config.testsuite.name || testsuiteName;
	var sapUiCoreBasePath = 'src/sap.ui.core';
	config.allLibraries.forEach(function(oLib, i) {
		if (oLib.name === 'sap.ui.core') {
			sapUiCoreBasePath = oLib.path;
		}
	});
	var sapUiTestsuiteBasePath = config.testsuite.path;
	var sapUiBuildtime = config.buildtime;
github SAP / ui5-project / test / lib / extensions.js View on Github external
return projectPreprocessor.processTree(tree).then((parsedTree) => {
		t.deepEqual(parsedTree.dependencies.length, 0, "Application project has no dependencies");
		const {middlewareRepository} = require("@ui5/server");
		t.truthy(middlewareRepository.getMiddleware("middleware.a"),
			"middleware.a has been added to the middleware repository");
	});
});
github SAP / ui5-project / lib / projectPreprocessor.js View on Github external
handleServerMiddleware(extension) {
		if (!extension.metadata && !extension.metadata.name) {
			throw new Error(`Middleware extension ${extension.id} is missing 'metadata.name' configuration`);
		}
		if (!extension.middleware) {
			throw new Error(`Middleware extension ${extension.id} is missing 'middleware' configuration`);
		}
		const {middlewareRepository} = require("@ui5/server");

		const middlewarePath = path.join(extension.path, extension.middleware.path);
		middlewareRepository.addMiddleware(extension.metadata.name, middlewarePath);
	}
}

@ui5/server

UI5 Tooling - Server

Apache-2.0
Latest version published 3 months ago

Package Health Score

83 / 100
Full package analysis