Git Product home page Git Product logo

nestjs-blog's Introduction

NestJS Blog

This is an example of how to use nestjs with jwt and typeorm to build a basic blog API.

Use

  • Start the mysql container using docker
$ docker-compose up -d 
  • Start the nestjs process using to following
$ yarn start

Production

If you're going to use this example in production (or your own verison of it) it's recommended to run using the 'complied' JS version from dist. You can do this by using the following command

$ yarn start:prod

This command will also clean and build your dist folder

Development

For development, the best command to use is

$ yarn start:dev

This will start nodemon to reload our script when there's been any changes in the src directory

Testing

Unit testing

Unit tests can be ran by simply using the test script

$ yarn test

This will run jest on all .spec.ts files.

End to End testing (E2E)

End to end tests can be run by using the following command

$ yarn test:e2e

this will run jest on all .e2e-spec.ts files.

Coverage

Use jest to show you a coverage of your tests

$ yarn test:cov

Build your own NestJS application

Want to get started on your own NestJS application? Simply install the nest-cli npm i -g @nestjs/cli and use the command nest new my-application to create a new directory called my-application with nestjs ready to go!

Packages

I used a variety of packages to develop this example api. Here's a list of them and where I got them from

nestjs-blog's People

Contributors

bashleigh avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.