How to use the @hapi/glue.compose function in @hapi/glue

To help you get started, we’ve selected a few @hapi/glue 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 metoikos / hapi-moon / test / all-routes.js View on Github external
before(async () => {
        server = await Glue.compose(serverConfig.manifest, options);

        const res = await server.inject({
            url: `/`,
            method: 'get'
        });
        const header = res.headers['set-cookie'];

        // ref: https://github.com/hapijs/crumb/blob/master/test/index.js#L134
        cookie = header[0].match(/crumb=([^\x00-\x20\"\,\;\\\x7F]*)/);
    });
github mattboutet / user-pal / server / index.js View on Github external
exports.deployment = async (start) => {

    const manifest = Manifest.get('/', process.env);
    const server = await Glue.compose(manifest, { relativeTo: __dirname });

    await server.initialize();

    // $lab:coverage:off$
    if (!start) {
        return server;
    }

    await server.start();

    console.log(`Server started at ${server.info.uri}`);

    return server;

};
github academia-de-codigo / noire-server / lib / utils / manager.js View on Github external
exports.start = async function(plugins) {
    ConfigValidation.validate(Config);

    // create a new hapi server
    const server = await Glue.compose(
        internals.buildManifest(plugins),
        {
            relativeTo: internals.pluginsPath
        }
    );

    Hoek.assert(server.settings.app, 'server settings should not be empty');

    // get the server name
    const connection = server.settings.app.name;
    Hoek.assert(connection, 'server requires a name setting');

    // create a new exiting manager for all the hapi servers
    internals.manager = Exiting.createManager(server);
    await internals.manager.start();
github metoikos / hapi-moon / server.js View on Github external
const startServer = async function () {
    try {
        const server = await Glue.compose(serverConfig.manifest, options);
        await server.start();
        console.log(`Server listening on ${server.info.uri}`);
    }
    catch (err) {
        console.error(err);
        process.exit(1);
    }
};
github jedireza / frame / server.js View on Github external
const main = async function () {

    const options = { relativeTo: __dirname };
    const server = await Glue.compose(Manifest.get('/'), options);

    await server.start();

    console.log(`Server started on port ${Manifest.get('/server/port')}`);
};

@hapi/glue

Server composer for hapi.js

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis

Popular @hapi/glue functions