0.2.3 ā€¢ Published 1 year ago

aero-ts v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Easy and Lightweight Way to create an Advanced Web Server in Node.js

šŸ  Homepage

Install

using npm

npm i aero-ts

using yarn

yarn add aero-ts

using pnpm

pnpm add aero-ts

Features

  • Compression Support
  • Multithreading Support
  • Websocket Support (soon)
  • Middleware Support (soon)
  • HTTPS Support
  • Async Support

Usage

Initialize Server

/**
 * NOTE:
 * This Project is not finished at all and
 * may not be a good idea to use right now.
*/

import aero from "aero-ts"
// or
const aero = require("aero-ts")


const server = new aero.Server({
  port: 3000,
  bind: '0.0.0.0',
  debug: true
  threading: {
    available: 2,
    automatic: true,
    sync: 20000
  }
})

server.routes
  .add('GET', '/', (ctx) => {
    ctx.print('Hello! Im running on the aero-ts beta...')
  })
  .add('GET', '/<username>', (ctx) => { // This is a placeholder, basically /anything will match to this except if there is a static route
    ctr.print('Hello ${ctx.params.get('username')}! How are you?')
  })
  .redirect('/cool', 'https://rjansen.de') // Redirect from /cool to https://rjansen.de
  .prefix('/api')
    .add('GET', '/', (ctx) => {
      ctx.print('You are currently on /api even though the method says / because of the Prefix')
    })
    .prefix('/v2')
      .add('GET', '/', (ctx) => {
        ctx.print('This is the v2 Homepage')
      })

server.start()

Author

šŸ‘¤ 0x4096

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check out the issues.

Show your support

Give a Star if this project helped you!

šŸ“ License

Copyright Ā© 2023 0x4096. This project is MIT licensed.

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago