From b2a42533b683b2e2cf76b6468c7279f33f2db493 Mon Sep 17 00:00:00 2001 From: Devin Ivy Date: Sun, 11 Apr 2021 23:24:17 -0400 Subject: [PATCH] commmm --- package.json | 35 ++++++++------------------- server/manifest.js | 35 ++++----------------------- server/plugins/swagger.js | 50 +++++++++++++++++++-------------------- 3 files changed, 39 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index c53dc44..77ab7db 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,7 @@ { - "name": "iut-project-cemal", - "version": "1.0.0", - "description": "", - "author": "", - "license": "ISC", + "name": "hapipal-boilerplate", + "version": "3.0.0", "main": "lib/index.js", - "directories": { - "lib": "lib", - "test": "test" - }, "scripts": { "start": "node server", "test": "lab -a @hapi/code -I \"__core-js_shared__,CSS,regeneratorRuntime,core\" -L", @@ -17,14 +10,7 @@ "dependencies": { "@hapi/boom": "9.x.x", "@hapipal/haute-couture": "4.x.x", - "joi": "17.x.x", - "objection": "2.x.x", - "@hapipal/schwifty": "6.x.x", - "sqlite3": "5.0.2", - "exiting": "6.0.1" - }, - "peerDependencies": { - "knex": "0.21.x" + "joi": "17.x.x" }, "devDependencies": { "@hapi/code": "8.x.x", @@ -32,18 +18,17 @@ "@hapi/eslint-plugin-hapi": "4.x.x", "@hapi/glue": "8.x.x", "@hapi/hapi": "20.x.x", - "@hapi/hoek": "9.x.x", "@hapi/inert": "6.x.x", - "@hapi/lab": "23.x.x", + "@hapi/lab": "24.x.x", "@hapi/vision": "6.x.x", - "babel-eslint": "10.x.x", "@hapipal/confidence": "6.x.x", - "dotenv": "8.x.x", - "eslint": "7.x.x", - "hapi-swagger": "14.x.x", "@hapipal/hpal": "3.x.x", "@hapipal/hpal-debug": "2.x.x", - "knex": "^0.21.16", - "@hapipal/toys": "3.x.x" + "@hapipal/toys": "3.x.x", + "babel-eslint": "10.x.x", + "dotenv": "8.x.x", + "eslint": "7.x.x", + "exiting": "6.x.x", + "hapi-swagger": "14.x.x" } } diff --git a/server/manifest.js b/server/manifest.js index f092f18..0344f12 100644 --- a/server/manifest.js +++ b/server/manifest.js @@ -3,7 +3,6 @@ const Dotenv = require('dotenv'); const Confidence = require('@hapipal/confidence'); const Toys = require('@hapipal/toys'); -const Schwifty = require('@hapipal/schwifty'); // Pull .env into process.env Dotenv.config({ path: `${__dirname}/.env` }); @@ -13,14 +12,14 @@ module.exports = new Confidence.Store({ server: { host: 'localhost', port: { - $env: 'PORT', + $param: 'PORT', $coerce: 'number', $default: 3000 }, debug: { - $filter: { $env: 'NODE_ENV' }, + $filter: 'NODE_ENV', $default: { - log: ['error'], + log: ['error', 'start'], request: ['error'] }, production: { @@ -34,35 +33,9 @@ module.exports = new Confidence.Store({ plugin: '../lib', // Main plugin options: {} }, - { - plugin: './plugins/swagger' - }, - { - plugin: '@hapipal/schwifty', - options: { - $filter: 'NODE_ENV', - $default: {}, - $base: { - migrateOnStart: true, - knex: { - client: 'sqlite3', - useNullAsDefault: true, // Suggested for sqlite3 - connection: { - filename: ':memory:' - }, - migrations: { - stub: Schwifty.migrationsStubPath - } - } - }, - production: { - migrateOnStart: false - } - } - }, { plugin: { - $filter: { $env: 'NODE_ENV' }, + $filter: 'NODE_ENV', $default: '@hapipal/hpal-debug', production: Toys.noop } diff --git a/server/plugins/swagger.js b/server/plugins/swagger.js index c97082b..19595d1 100644 --- a/server/plugins/swagger.js +++ b/server/plugins/swagger.js @@ -1,25 +1,25 @@ -'use strict'; - -const Inert = require('@hapi/inert'); -const Vision = require('@hapi/vision'); -const HapiSwagger = require('hapi-swagger'); -const Package = require('../../package.json'); - -module.exports = { - name: 'app-swagger', - async register(server) { - - await server.register([ - Inert, - Vision, - { - plugin: HapiSwagger, - options: { - info: { - version: Package.version - } - } - } - ]); - } -}; +'use strict'; + +const Inert = require('@hapi/inert'); +const Vision = require('@hapi/vision'); +const HapiSwagger = require('hapi-swagger'); +const Package = require('../../package.json'); + +module.exports = { + name: 'app-swagger', + async register(server) { + + await server.register([ + Inert, + Vision, + { + plugin: HapiSwagger, + options: { + info: { + version: Package.version + } + } + } + ]); + } +}; \ No newline at end of file