Skip to content

Commit

Permalink
removed ajv keywords dependencies for ajv-validator/ajv-keywords#164
Browse files Browse the repository at this point in the history
  • Loading branch information
matt212 committed Mar 30, 2021
1 parent aed1eda commit df54e70
Show file tree
Hide file tree
Showing 6 changed files with 7,800 additions and 1,416 deletions.
6 changes: 0 additions & 6 deletions app/config/baseRoute.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,4 @@
}, {
"val": "userrole",
"key": "userrolemapping"
}, {
"val": "gender",
"key": "gender"
}, {
"val": "mroleset",
"key": "mroleset"
}]
2 changes: 2 additions & 0 deletions app/public/admin/js/app/app_employees.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,6 @@ killzone.forEach((element, index) => {
afterhtmlpopulate: function() {

}
,customClearControl:function(){
}
}
104 changes: 52 additions & 52 deletions app/utils/app.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
const pinoInspector = require('pino-inspector')
const path = require('path')
const fs = require('fs')
const fastify = require('fastify')({
// logger: { prettyPrint: true, level: 'debug', prettifier: pinoInspector },
ajv: {
plugins: [[require('ajv-keywords'), ['transform']]]
}
})
fastify.register(require('fastify-multipart'))
const pinoInspector = require("pino-inspector");
const path = require("path");

const fastify = require("fastify")({
logger: { prettyPrint: true, level: "debug", prettifier: pinoInspector },
// ajv: {
// plugins: [[require("ajv-keywords"), ["transform"]]],
// },
});
fastify.register(require("fastify-multipart"));

fastify.register(
require('fastify-compress'),
require("fastify-compress"),
{ global: false },
{ encodings: ['gzip'] }
)
{ encodings: ["gzip"] }
);

fastify.register(require('point-of-view'), {
fastify.register(require("point-of-view"), {
engine: {
ejs: require('ejs')
ejs: require("ejs"),
},
root: path.join(__dirname, '../views')
})
fastify.register(require('fastify-cors'))
fastify.register(require('fastify-jwt'), {
secret: 'supersecret',
expiresIn: '1h'
})
root: path.join(__dirname, "../views"),
});
fastify.register(require("fastify-cors"));
fastify.register(require("fastify-jwt"), {
secret: "supersecret",
expiresIn: "1h",
});

fastify.register(require('fastify-static'), {
root: path.join(__dirname, '../') + '/public'
fastify.register(require("fastify-static"), {
root: path.join(__dirname, "../") + "/public",
// optional: default '/'
})
});

fastify.register(require('fastify-secure-session'), {
secret: 'averylogphrasebiggerthanfortytwochars',
salt: 'mq9hDxBVDbspDR6n',
fastify.register(require("fastify-secure-session"), {
secret: "averylogphrasebiggerthanfortytwochars",
salt: "mq9hDxBVDbspDR6n",
cookie: {
path: '/'
path: "/",
// options for setCookie, see https://github.com/fastify/fastify-cookie
}
})
fastify.register(require('../../app/config/baseAuth'))
fastify.register(require('../routes/customauth'), { prefix: '/' })
fastify.register(require('../routes/utils/misc/jynerso'), {
prefix: '/black-squadron'
})
let baseroutes = require('../config/baseRoute')
},
});
fastify.register(require("../../app/config/baseAuth"));
fastify.register(require("../routes/customauth"), { prefix: "/" });
fastify.register(require("../routes/utils/misc/jynerso"), {
prefix: "/black-squadron",
});
let baseroutes = require("../config/baseRoute");
baseroutes.forEach(function (dt) {
fastify.register(require(`../routes/${dt.val}`), { prefix: dt.key })
})
fastify.register(require(`../routes/${dt.val}`), { prefix: dt.key });
});

// Run the server!
fastify.listen(3011, function (err, address) {
if (err) {
fastify.log.error(err)
process.exit(1)
fastify.log.error(err);
process.exit(1);
}
console.log(`App Server listening on port ${address}`)
})
fastify.register(require('fastify-socket.io'), {
console.log(`App Server listening on port ${address}`);
});
fastify.register(require("fastify-socket.io"), {
// put your options here
})
});
// //using express for only swagger panel
var express = require('express')
var Swaggerapp = express()
const swaggerSpec = require('./configuration/swagger')
const swaggerUi = require('swagger-ui-express')
Swaggerapp.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec))
var express = require("express");
var Swaggerapp = express();
const swaggerSpec = require("./configuration/swagger");
const swaggerUi = require("swagger-ui-express");
Swaggerapp.use("/api-docs", swaggerUi.serve, swaggerUi.setup(swaggerSpec));
Swaggerapp.listen(3012, function () {
console.log('Swagger Server listening on http://localhost:3012/api-docs/')
})
console.log("Swagger Server listening on http://localhost:3012/api-docs/");
});
Loading

0 comments on commit df54e70

Please sign in to comment.