@duplojs/what-was-sent
TypeScript icon, indicating that this package has built-in type declarations

1.5.4 • Public • Published

duplojs-what-was-sent

NPM version

Instalation

npm i @duplojs/what-was-sent

Implémentation

import Duplo, {zod} from "@duplojs/duplojs";
import duploWhatWasSent, {IHaveSentThis} from "@duplojs/what-was-sent";

const duplo = Duplo({port: 1506, host: "localhost", environment: "DEV"});

duplo.use(duploWhatWasSent, {
    enabled: duplo.config.environment ===  "DEV"
});

duplo.declareRoute("GET", "/test/1")
.handler(
    ({}, res) => {
        res.code(200).send(100);
    },
    new IHaveSentThis(200, zod.string()) 
);

duplo.launch();

Implémentation globales

duplo.use(duploWhatWasSent, {
    ...
    globals: true
});

tsconfig.json

{
  "compilerOptions": {
    ...
    "types": [
        "@duplojs/what-was-sent/globals"
    ],
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @duplojs/what-was-sent

Weekly Downloads

199

Version

1.5.4

License

ISC

Unpacked Size

15.1 kB

Total Files

7

Last publish

Collaborators

  • mathcovax