An open API service indexing awesome lists of open source software.

https://github.com/jangbl/node-express-validator-tutorial

demonstrates how to use the express-validator package with Typescript
https://github.com/jangbl/node-express-validator-tutorial

Last synced: 3 months ago
JSON representation

demonstrates how to use the express-validator package with Typescript

Awesome Lists containing this project

README

          

# express-validator Node.js tutorial

This repository contains sample code on how use the [express-validator](https://github.com/express-validator/express-validator) together with _Typescript_.

Please help this repo with a ⭐️ if you find it useful! 😁

This repository contains the code for the flowwing[express-validator Node.js tutorial on Youtube](https://www.youtube.com/watch?v=7i7xmwowwCY).

[![express-validator-node-js-tutorial](images/express-validator-node-js-tutorial.png)](https://www.youtube.com/watch?v=7i7xmwowwCY)

For updates, please reach out to [@_jgoebel](https://twitter.com/_jgoebel) on Twitter.

Please also check out my website at [jangoebel.com](https://jangoebel.com)

# How to run this application

## Running the project

Make sure to install the dependencies with `npm`

```
npm install
```

You can then run the project by executing

```
npm run dev
```

which will start up a development server on port `8080`.

## API

### POST /register

Expected payload

```
{
"email": "john@example.com",
"password": "your-password"
}
```

The server will return a `400` bad request error if the request body does not conform to the expected schema (valid email and a password with at least `5` characters).

Please also check out the `./schema` directory to learn more about the expected request body.