Skip to content

Instantly share code, notes, and snippets.

View mackignacio's full-sized avatar
🏠
Working from home

Mack Ignacio mackignacio

🏠
Working from home
View GitHub Profile
@mackignacio
mackignacio / paymongo_custom_links.ts
Last active July 22, 2022 04:19
Payment Provider
import { Injectable } from "@mayajs/core";
@Injectable() // This decorator allows this class to be injected on other modules
export class SampleServices {
constructor( // Inject other services here) {}
}
import { MongoSchema, MongoModel } from "@mayajs/mongo";
const schema = MongoSchema({
// Add mongo fields here
});
export default MongoModel("Sample", schema);
import { SampleController } from "./controllers/sample/sample.controller";
export const routes = [
{
controllers: [SampleController],
middlewares: [],
path: "",
},
];
import { Get, Patch, Post, Delete, Put } from "@mayajs/common";
import { Controller } from "@mayajs/core";
@Controller({
model: "./sample.model", // Name of the model for this route
route: "/sample", // Name of the route
})
export class SampleController {
constructor( // Inject services here ) {}
}