Skip to content

shubhamDP-arch/puda.ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PUDA.TS

🚨 MY PERSONAL PROJECT, DON’T USE IT FOR YOUR NEXT MILLION-DOLLAR PROJECT 🚨

Overview

PUDA is a backend library that provides basic tools to create APIs. It’s a fast, unopinionated, and minimalist library for Node.js.

Features

  • 🚀 Feature 1 – Consists of a file-based router
  • 🔌 Feature 2 – Middleware support
  • 📦 Feature 3 – Built-in body parser
  • 🔒 Feature 4 – Has built-in type safety
  • 😄 Feature 5 – Easy to use and user-friendly

Installation

To install PUDA.TS, run the following:

npm install puda.ts

Example usage:

import { Server, initializeRouter } from "puda.ts";

const router = initializeRouter("./<name of your folder for routes>");

const server = new Server(router);

server.start(PORTNUMBER, () => console.log("Server running at http://localhost:PORTNUMBER"));

PUDA.TS uses a file-based API router where each file in your directory is automatically mapped to a route. There’s no need to manually define routes in a configuration file.

Prerequisites

  • Make sure you have TypeScript and Node.js installed.
  • Also ensure ts-node is installed globally.

Setup

Add the following script to your package.json:

"scripts": {
  "start": "npm link puda.ts && npx ts-node-dev --watch --respawn --clear route.ts"
}

Once added, simply run the script to start the server, and you're good to go!

Basic HTTP Response in PUDA.TS

import { Request, Response } from 'puda.ts'; 

export default function GET(req: Request, res: Response): void {
    res.send(200, "hello mom");
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •