Skip to content

Latest commit

 

History

History
152 lines (100 loc) · 4.36 KB

README.md

File metadata and controls

152 lines (100 loc) · 4.36 KB

Hyper Express Starter

Get started with Hyper Express effortlessly

GitHub issues GitHub stars GitHub license

Features

  • Well-structured: Organized project structure to get you started quickly and efficiently.
  • Middleware Examples: Ready-to-use middleware examples to handle various functionalities.
  • Router Examples: Examples of setting up routers to manage different routes.
  • Mongoose and MongoDB: Integrated with Mongoose and MongoDB for seamless database operations.
  • Logger: Built-in logging functionality to monitor your application's performance.
  • Async Error Handling: Handles asynchronous errors gracefully.
  • Global Error Handling: Centralized error handling mechanism to manage errors efficiently.

Motivation

Hyper Express Starter is designed to provide a quick and easy setup for developers to start building high-performance web applications using Hyper Express. Leveraging the power of uWebsockets.js, this starter kit ensures that your applications can handle high throughput with existing hardware.

Installation

Getting Started

  • Clone the repository:
  git clone https://github.com/AhmedEl5WaGa/hyper-express-starter.git
  cd hyper-express-starter
  • Install dependencies:

    Ensure you have Node.js installed, then run the following command to install the dependencies:

    npm install
  • Set up environment variables as needed.

    rename .env.sample to .env

  • Start the server:

    • dev
     npm run dev
    • prod
     npm run start

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

NODE_ENV development | production

PORT 4000

MONGODB_URL

API Reference

Get all APIs

  GET /v1/api

Post API

  POST /v1/api
Body Type Description
name string Required. Name of api to create
description string Not Required. Description of api to create

Get One API

  GET /v1/api/${id}
Parameter Type Description
id string Required. Id of api to fetch

Put One api

  PUT /v1/api/${id}
Parameter Type Description
id string Required. Id of api to update
Body Type Description
name string Not Required. Name of api to update
description string Not Required. Description of api to update

Delete One API

  DELETE /v1/api/${id}
Parameter Type Description
id string Required. Id of api to delete

Documentation

  • Middlewares Check out the middlewares/ directory for examples of how to create and use middleware in your application.

  • Routers The routers/ directory contains examples of setting up routes and handling different HTTP methods.

  • Mongoose and MongoDB In the router/v1/api/api.model.js directory, you can find examples of Mongoose models and how to interact with MongoDB from api.controller.js.

  • Logger The utilities/loggers folder provides a simple logging mechanism to help you monitor your application's performance.

  • Async Error Handling Errors in asynchronous operations are handled gracefully using utility functions.

  • Global Error Handling A centralized error handling mechanism is implemented to manage all errors efficiently.

  • Contributing Contributions are welcome! Feel free to open issues or submit pull requests to enhance the project.

License

MIT