Skip to content

Commit

Permalink
feat restart project and add Factory
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Feb 9, 2022
1 parent 0f2c9b5 commit 628a464
Show file tree
Hide file tree
Showing 12 changed files with 2,904 additions and 472 deletions.
Binary file added .DS_Store
Binary file not shown.
60 changes: 2 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Core 🧠

> Core stuffs to your NodeJS project
> The core of SecJS packages
[![GitHub followers](https://img.shields.io/github/followers/jlenon7.svg?style=social&label=Follow&maxAge=2592000)](https://github.com/jlenon7?tab=followers)
[![GitHub stars](https://img.shields.io/github/stars/secjs/core.svg?style=social&label=Star&maxAge=2592000)](https://github.com/secjs/core/stargazers/)
Expand All @@ -23,71 +23,15 @@ The intention behind this repository is to concentrate all `SecJS` libraries to

<img src=".github/core.png" width="200px" align="right" hspace="30px" vspace="100px">

## WARN 🛑⚠️

> This project is under `development` do not use it until releases v2.0.0.
## Installation

> To use the high potential from this package you need to install first this other packages from SecJS,
> it keeps as dev dependency because one day `@secjs/core` will install everything once.
```bash
npm install @secjs/utils @secjs/exceptions
```

> Then you can install the package using:
```bash
npm install @secjs/core
```

## Decorators

### Controller

> Use `Controller` decorator to map a controller to your application
```ts
import { Controller } from '@secjs/core'

@Controller('/tests')
class TestController {}
```

### Request Mappers - GET/POST/PUT/DELETE/ETC...

> Use `GET, POST, PUT, DELETE, PATCH, ALL, OPTIONS, HEAD` decorators to map the real route for your application
```ts
import { Get, Post, Put, Delete } from '@secjs/core'

@Controller('/tests')
class TestController {
@Get()
async getAll() {}

@Get('/:id')
async getOne() {}

@Post()
async create() {}

@Put(':id')
async update() {}

@Delete('/:id')
async delete() {}
}

// Routes created:
//
// /tests GET
// /tests/:id GET
// /tests POST
// /tests/:id PUT
// /tests/:id DELETE
```
#### Under development

---

Expand Down
3 changes: 1 addition & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './src/Decorators/Http/Controller'
export * from './src/Decorators/Http/RequestMapping'
export * from './src/Factory'
Loading

0 comments on commit 628a464

Please sign in to comment.