Skip to content

Instantly share code, notes, and snippets.

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

Mr. Binary Sniper MrBns

🏠
Working from home
View GitHub Profile
format = """
[░▒▓]( fg:green)\
[ 󰁥 ](bg:green fg:fg_white)\
$username\
[](bg:white fg:green)\
$directory\
[](fg:white bg:red)\
$git_branch\
$git_status\
[](fg:red bg:black)\
@MrBns
MrBns / api_return.js
Created March 29, 2024 23:36
Send Fastify Response Within ia Schema
import { FastifyReply } from "fastify";
export function valid_reply(rep: FastifyReply, data: object | null | undefined, msg = "Successful Response", status = 200) {
return rep.send({
message: msg,
success: true,
error: false,
statusCode: status,
data,
});