You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.1 KiB
52 lines
1.1 KiB
3 years ago
|
const fastify = require("fastify");
|
||
|
const adminController = require('../controllers/admincontroller')
|
||
|
|
||
|
|
||
|
module.exports = function (fastify, opts, next) {
|
||
|
fastify.route({
|
||
|
method: "POST",
|
||
|
url: "/api/adminSignup",
|
||
|
schema: {
|
||
|
tags: ["Admin"],
|
||
|
description: "This is for cretae New Admin Account",
|
||
|
summary: "This is for cretae New Admin Account",
|
||
|
body: {
|
||
|
type: "object",
|
||
|
properties: {
|
||
|
email: { type: "string" },
|
||
|
password: { type: "string" },
|
||
|
|
||
|
},
|
||
|
},
|
||
|
security: [
|
||
|
{
|
||
|
basicAuth: [],
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
|
||
|
handler: adminController.adminSignUp,
|
||
|
|
||
|
});
|
||
|
|
||
|
fastify.post("/api/adminLogin", {
|
||
|
schema: {
|
||
|
description: "This is for Login Admin",
|
||
|
tags: ["Admin"],
|
||
|
summary: "This is for Login Admin",
|
||
|
body: {
|
||
|
type: "object",
|
||
|
required: ["email", "password"],
|
||
|
properties: {
|
||
|
email: { type: "string" },
|
||
|
password: { type: "string" },
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
handler: adminController.adminLogin,
|
||
|
});
|
||
|
|
||
|
|
||
|
next();
|
||
|
};
|