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
- Host: GitHub
- URL: https://github.com/jangbl/node-express-validator-tutorial
- Owner: jangbl
- Created: 2021-03-20T15:45:21.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-13T11:01:06.000Z (over 2 years ago)
- Last Synced: 2025-04-30T09:55:48.429Z (9 months ago)
- Language: TypeScript
- Size: 1.43 MB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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).
[](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.