How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • //...
    const Hapi = require('hapi');
    
    const server = new Hapi.Server();
    server.connection({ port: 8080 });
    
    server.route([
        {
            method: 'GET',
            path: '/hello_world',
            handler: function (request, reply) {
                reply('Hello World');
            }
        }
    ]);
    
    
    
    //...
    
    /Magnitus-/DockerFiles mit
  • const register = () => {
      const connection = { host: 'localhost' }
      const server = new Hapi.Server(connection)
      server.validator(require('@hapi/joi'))
    
      server.route({
        method: 'GET',
        path: '/',
        handler: (request, h) => []
      })
    
      
    
      //...
    }
    
    
    /fknop/hapi-pagination mit
  • const Koa = require('koa');
    const Router = require('@koa/router');
    const Boom = require('@hapi/boom');
    
    const app = new Koa();
    const router = new Router();
    
    app.use(router.routes());
    app.use(router.allowedMethods({
      throw: true,
      notImplemented: () => Boom.notImplemented(),
      methodNotAllowed: () => Boom.methodNotAllowed()
    }));
    Docs
  • import {
      ApolloServer,
      ApolloServerPluginStopHapiServer
    } from 'apollo-server-hapi';
    import Hapi from '@hapi/hapi';
    
    async function startApolloServer(typeDefs, resolvers) {
      const app = Hapi.server({ port: 4000 });
      const server = new ApolloServer({
        typeDefs,
        resolvers,
        plugins: [ApolloServerPluginStopHapiServer({ hapiServer: app })],
      });
    
      await server.start();
      await server.applyMiddleware({ app });
      await app.start();
    }
    Docs
  • Boom.tooEarly('the server is unwilling to risk processing the request');
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples