Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

manifest.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. // Pull .env into process.env
  8. Dotenv.config({ path: `${__dirname}/.env` });
  9. // Glue manifest as a confidence store
  10. module.exports = new Confidence.Store({
  11. server: {
  12. host: process.env.API_HOST,
  13. port: {
  14. $filter: 'NODE_ENV',
  15. $default: {
  16. $param: 'API_PORT',
  17. $coerce: 'number',
  18. $default: process.env.API_PORT
  19. },
  20. test: { $value: undefined } // Let the server find an open port
  21. },
  22. debug: {
  23. $filter: 'NODE_ENV',
  24. $default: {
  25. log: ['error', 'start'],
  26. request: ['error']
  27. },
  28. production: {
  29. request: ['implementation']
  30. }
  31. }
  32. },
  33. register: {
  34. plugins: [
  35. {
  36. plugin: '../lib', // Main plugin
  37. routes: {
  38. prefix: '/api'
  39. },
  40. options: {
  41. jwtKey: {
  42. $filter: 'NODE_ENV',
  43. $default: {
  44. $param: 'APP_SECRET',
  45. $default: 'app-secret'
  46. },
  47. production: { // In production do not default to "app-secret"
  48. $param: 'APP_SECRET'
  49. }
  50. }
  51. }
  52. },
  53. // Documentaion deps
  54. Inert,
  55. Vision,
  56. {
  57. plugin: HapiSwagger,
  58. options: {
  59. info: { title: 'Test API Documentation' }
  60. }
  61. },
  62. {
  63. plugin: Schwifty,
  64. options: {
  65. $filter: 'NODE_ENV',
  66. $default: {},
  67. $base: {
  68. migrateOnStart: true,
  69. knex: {
  70. client: process.env.DB_TYPE,
  71. useNullAsDefault: true,
  72. connection: {
  73. host : process.env.DB_HOST,
  74. user : process.env.DB_USER,
  75. password : process.env.DB_ROOT_PASSWORD,
  76. database : process.env.DB_NAME
  77. }
  78. }
  79. },
  80. production: {
  81. migrateOnStart: false
  82. }
  83. }
  84. }
  85. ]
  86. }
  87. })