Skip to content

Commit

Permalink
Merge pull request #30 from AthennaIO/develop
Browse files Browse the repository at this point in the history
feat: add cors and rate limit plugin
  • Loading branch information
jlenon7 authored Apr 12, 2022
2 parents 4afc0b7 + 03d03cd commit 3372f84
Show file tree
Hide file tree
Showing 5 changed files with 390 additions and 38 deletions.
135 changes: 106 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/core",
"version": "1.2.7",
"version": "1.2.8",
"description": "",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down Expand Up @@ -161,7 +161,7 @@
"@athenna/config": "1.0.8",
"@athenna/ioc": "1.1.3",
"@athenna/logger": "1.1.7",
"@athenna/http": "1.2.4",
"@athenna/http": "1.2.6",
"@secjs/utils": "1.8.3",
"reflect-metadata": "0.1.13",
"tscpaths": "0.0.9"
Expand Down
10 changes: 8 additions & 2 deletions src/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,18 @@ export class Application {
private async resolveHttpKernel() {
const { dir, name } = parse(Path.app('Http/Kernel'))

const HttpKernel = resolveModule(
const Kernel = resolveModule(
await import(`${dir}/${name}${this.extension}`),
)

const kernel = new Kernel()

this.logger.success('Booting the Http Kernel')

await new HttpKernel().registerMiddlewares()
await kernel.registerCors()
await kernel.registerRateLimit()
await kernel.registerErrorHandler()
await kernel.registerLogMiddleware()
await kernel.registerMiddlewares()
}
}
Loading

0 comments on commit 3372f84

Please sign in to comment.