How to use the consola.ready function in consola

To help you get started, we’ve selected a few consola 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 Accretion-dev / Accretion / brainhole / server / models / index.js View on Github external
status = await adminDB.command({replSetGetStatus:{}})
    }
    globals.db = globals.conn.db('accretion')

    await mongoose.connect(`mongodb://${ip}:${port}/accretion`, { useNewUrlParser: true })
    globals.history = globals.db.collection('History')
  } catch (e) {
    console.error(e)
    let msg = 'Database connetion error, do you really start the mongodb using the configs/mongod.yml config file???'
    consola.error(msg)
  }

  // clean database if test database and unittest
  if (databaseName === "test") {
    if (config.demoData || config.unittest) {
      consola.ready({
        message: `clean database`,
        badge: true
      })
      let dropResult = await mongoose.connection.db.dropDatabase()
    }
  }

  // if unittest, active all plugin by default
  await initPlugins({allActive: databaseName === "test" && config.unittest})
  initModels()
  if (databaseName === "test") {
    await initTestDatabase({config})
  } else {
    await initProductDatabase()
  }
}
github 44uk / nem2-faucet / server / index.ts View on Github external
await builder.build()
  } else {
    await nuxt.ready()
  }

  const appConfig = await bootstrap.init()

  app.get('/', faucetHandler(appConfig))
  app.post('/claims', claimsHandler(appConfig))

  // Give nuxt middleware to express
  app.use(nuxt.render)

  // Listen the server
  app.listen(port, host)
  consola.ready({
    message: `Server listening on http://${host}:${port}`,
    badge: true
  })

  const { API_URL, FAUCET_ACCOUNT } = appConfig
  monitor(API_URL, FAUCET_ACCOUNT.address)
}
start()
github breach-tw / breach.tw / server / index.js View on Github external
multipart: true,
    parsedMethods: ['POST', 'DELETE', 'PATCH']
  }));

  router.use('/api', api.routes(), api.allowedMethods())
  app.use(router.routes()).use(router.allowedMethods())

  app.use((ctx) => {
    ctx.status = 200
    ctx.respond = false // Bypass Koa's built-in response handling
    ctx.req.ctx = ctx // This might be useful later on, e.g. in nuxtServerInit or with nuxt-stash
    nuxt.render(ctx.req, ctx.res)
  })

  app.listen(port, host)
  consola.ready({
    message: `Server listening on http://${host}:${port}`,
    badge: true
  })
}
github Accretion-dev / Accretion / brainhole / server-src / models / index.js View on Github external
async function initTestDatabase ({config, databaseConfig}) {
  if (config.demoData || config.unittest) {
    consola.ready({
      message: `clean database`,
      badge: true
    })
    let dropResult = await mongoose.connection.db.dropDatabase()
  }
  await initIDs({config})
  // create default user
  let exist = await User.findOne({username: 'accretion'})
  if (!exist) {
    let user = new User({
      username: 'accretion',
      active: true,
    })
    await user.setPassword('cc')
    await user.save()
  }
github Uconnect-Technologies / wertik-js / frontend-app / vue-app / server / index.js View on Github external
host = process.env.HOST || '127.0.0.1',
    port = process.env.PORT || 3000
  } = nuxt.options.server

  // Build only in dev mode
  if (config.dev) {
    const builder = new Builder(nuxt)
    await builder.build()
  }

  // Give nuxt middleware to express
  app.use(nuxt.render)

  // Listen the server
  app.listen(port, host)
  consola.ready({
    message: `Server listening on http://${host}:${port}`,
    badge: true
  })
}
start()
github nuxt / create-nuxt-app / template / frameworks / micro / server / index.js View on Github external
}

  const server = micro(async (req, res) => {
    await dispatch().dispatch('*', ['GET'], (req, res) =>
      nuxt.render(req, res)
    )(req, res)
  })

  const {
    host = process.env.HOST || '127.0.0.1',
    port = process.env.PORT || 3000
  } = nuxt.options.server

  // Listen the server
  server.listen(port, host)
  consola.ready({
    message: `Server listening on http://${host}:${port}`,
    badge: true
  })
}
github repl-it-discord / carnival / front / server / index.js View on Github external
const { host, port } = nuxt.options.server;

  // Build only in dev mode
  if (config.dev) {
    const builder = new Builder(nuxt);
    await builder.build();
  } else {
    await nuxt.ready();
  }

  // Give nuxt middleware to express
  app.use(nuxt.render);

  // Listen the server
  app.listen(port, host);
  consola.ready({
    message: `Server listening on http://${host}:${port}`,
    badge: true
  });
}
start();
github nuxt / create-nuxt-app / template / frameworks / feathers / server / index.js View on Github external
if (config.dev) {
    const builder = new Builder(nuxt)
    await builder.build()
  } else {
    await nuxt.ready()
  }

  const configuration = require('@feathersjs/configuration')
  app.configure(configuration()).use(nuxt.render)

  const host = app.get('host')
  const port = app.get('port')

  app.listen(port)

  consola.ready({
    message: `Feathers application started on ${host}:${port}`,
    badge: true
  })
}
github credija / opa / server / index.js View on Github external
async function start() {
  const nuxt = new Nuxt(config);
  if (config.dev) {
    const builder = new Builder(nuxt);
    await builder.build();
  }

  app.use(nuxt.render);

  app.listen(port, host);
  consola.ready({
    message: `Opa is now running on the address: http://${host}:${port}`,
    badge: true
  });
  consola.info({
    message: `BaseURL: ${BASE_URL !== undefined ? BASE_URL : '/'}`,
    badge: true
  });
}
start();