Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

manifest.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. const Dotenv = require('dotenv');
  2. const Confidence = require('@hapipal/confidence');
  3. const Inert = require('@hapi/inert');
  4. const Vision = require('@hapi/vision');
  5. const Schwifty = require('@hapipal/schwifty');
  6. const HapiSwagger = require('hapi-swagger');
  7. const AppPlugin = require('../lib/plugins');
  8. // Pull .env into process.env
  9. Dotenv.config({ path: `${__dirname}/.env` });
  10. // Glue manifest as a confidence store
  11. module.exports = new Confidence.Store({
  12. server: {
  13. host: 'localhost',
  14. port: {
  15. $filter: 'NODE_ENV',
  16. $default: {
  17. $param: 'PORT',
  18. $coerce: 'number',
  19. $default: 3001
  20. },
  21. test: { $value: undefined } // Let the server find an open port
  22. },
  23. debug: {
  24. $filter: 'NODE_ENV',
  25. $default: {
  26. log: ['error', 'start'],
  27. request: ['error']
  28. },
  29. production: {
  30. request: ['implementation']
  31. }
  32. }
  33. },
  34. register: {
  35. plugins: [
  36. AppPlugin,
  37. // Documentaion deps
  38. Inert,
  39. Vision,
  40. {
  41. plugin: HapiSwagger,
  42. options: {
  43. info: { title: 'Test API Documentation' }
  44. }
  45. },
  46. {
  47. plugin: Schwifty,
  48. options: {
  49. $filter: 'NODE_ENV',
  50. $default: {},
  51. $base: {
  52. migrateOnStart: true,
  53. knex: {
  54. client: 'mysql',
  55. useNullAsDefault: true,
  56. connection: {
  57. host : 'localhost',
  58. user : 'root',
  59. password : 'root',
  60. database : 'test'
  61. }
  62. }
  63. },
  64. production: {
  65. migrateOnStart: false
  66. }
  67. }
  68. }
  69. ]
  70. }
  71. });