MohamedBeydoun / atlas

An express-typescript code generator
Apache License 2.0
6 stars 0 forks source link

Extract relevant information from the request into correctly typed local variables. #36

Open AsFal opened 4 years ago

AsFal commented 4 years ago

Given an endpoint that receives a body of type A and has a url parameter of type B with name param, the generator would add the following local variables to the top of the analog controller function.

const body: A = req.body;
const param: B = cast_to_B(req.params.param);