Socket
Book a DemoInstallSign in
Socket

@otterhttp/app

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@otterhttp/app

0-legacy, tiny & fast web framework as a replacement of Express

latest
Source
npmnpm
Version
3.4.9
Version published
Maintainers
0
Created
Source

@otterhttp/app

The core of tinyhttp. Contains the App, Request and Response. Additionally, it provides special tinyhttp-specific types.

Install

pnpm i @otterhttp/app

Example

import { App } from '@otterhttp/app'
import type { Request, Response, NextFunction } from '@otterhttp/app'

new App()
  .use((req: Request, res: Response, next: NextFunction) => {
    console.log('Did a request')
    next()
  })
  .get('/', (_, res) => res.send('<h1>Hello World</h1>'))
  .get('/page/:page', (req, res) => res.send(`You opened ${req.params.page}`))
  .listen(3000)

Keywords

otterhttp

FAQs

Package last updated on 05 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts