BuildForSDGCohort2 / Team-030-Backend

Server side
0 stars 1 forks source link

Agro-Mart: Team-030-Backend :rocket:

Please read carefully. Abeg na!

Instructions

General

ABOUT PR

This PR gives users the ability to register as farmers or as customers/consumers.

RELEVANT FILES

auth.js

ISSUE

$Issue_Number

Coding conventions

Classes

Classes should be defined and implemented in the following format:

Generally

export class SomeClass {
 someFunction() {
  console.log("This is some function. Some function I tell thee.");
 }
}

Controller Classes

export class SomeControllerClass {
 static async someControllerFunction() {
  try {
   console.log("O thou elusive one, be not confounded by this mystery for it is made clear by the forces that this be nothing other than a controller function.");
  } catch (error) {
   console.log("Ah! Your request was plunged into the deep blue sea where Davy Jones would make a caricature of it but fear not my brave one, for thou mayest try again.");
  }
 }
}

NB:

Exports and modules
// function.js
export default () => {
 console.log("I am a lonely function. Care to cuddle me to happiness?");
};
// folder > file1.js
export class File1Class {
}
// folder > file2.js
export class File2Class {
}
// folder > index.js
export * from "./file1";
export * from "./file2";
// anotherfolder > file.js
import { File1Class, File2Class } from "../folder";
API Responses

API responses should be in the following format:

res.status(200).json({
 statusCode: 200,
 response: "Hello Earth!"
});
console.log("Let's work magic together. Wave your wands buddies and may the force be with us.");

Codacy Badge