Skip to content

mapljs/stnl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stnl validators for @mapl/web.

import * as bodyParser from '@mapl/stnl/body-parser';
import { t } from 'stnl';

import { router, handle } from '@mapl/web';

const app = router([
  bodyParser.json(
    'body',
    t.dict({
      name: t.string,
      pwd: t.string
    })
  )
], [
  handle.get('/info', (c) => {
    const user = c.body;
    // Use props
    console.log(c.name, c.pwd);

    ...
  })
]);

About

stnl validators for mapl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published