Skip to content

Elentis is a straightforward tool for building REST APIs with Deno. It offers a simple, folder-based routing structure to help developers organize their projects. Designed with ease of use in mind, Elentis aims to make creating and managing RESTful APIs more convenient.

License

Notifications You must be signed in to change notification settings

tahsinkoc/elentis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ELENTIS REST API Tool for Deno runtime

Overview

This is a Deno runtime REST API Tool that provides a simple way to create RESTful APIs with folder-based routing. The library allows you to easily organize your API endpoints and handle requests with ease.

Features

  • Folder-based routing
  • Easy to use request handlers
  • Support for nested routes
  • Built-in method handling (GET, POST, etc.)
  • Simple and clean code structure

Installation

To use this Tool, you need to have Deno installed on your machine. You can download it from Deno's official website.

Usage

  1. Clone this repository to your local machine:

    git clone https://github.com/tahsinkoc/elentis.git
    cd elentis
    
  2. Create your API structure in the api folder. Each folder can have an index.ts file that exports a request handler function.

  3. Start the server

    deno run --allow-net main.ts
  4. Acces the API endpoints.

    /weather
    /weather/city
    

Example

Here’s a simple example of how to set up an API endpoint:

// api/weather/index.ts
import { getWeather } from "../../components/CreateWeather.ts";

export default function GET() {
    const weather = getWeather();
    return new Response(JSON.stringify(weather), {
        'headers': {
            'Content-Type': 'application/json'
        },
        status: 200
    })
}

export const method = 'GET';

Testing

To run the tests, use the following command:

deno test --allow-read --allow-net

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Elentis is a straightforward tool for building REST APIs with Deno. It offers a simple, folder-based routing structure to help developers organize their projects. Designed with ease of use in mind, Elentis aims to make creating and managing RESTful APIs more convenient.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published