GithubHelp home page GithubHelp logo

api_nest_pokemons's Introduction

Description

A API project made with nestJs that work with a pokemon database

Pre requisites

  • Have mongodb installed in your machine
  • Node v10.15
  • NPM 6.4
  • Yarn 1.15

You have to rename the file sampleenvfile to .env and you can change the url and the name of both the database and the test database.

Installation

$ yarn install

Migration

First you have to run the migration script, be sure that your mongo server is running

# create the database
$ yarn migrate

This command will create a database called pokemondb in your mongo server

Running the app

# build the app
$ yarn build

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

API

By default the app will run on port 3000 Here is the list of all the endpoints

Pokemons

Get all pokemons GET http://localhost:3000/pokemons

Get one pokemon GET http://localhost:3000/pokemons/pikachu

Get image of pokemon http://localhost:3000/pokemons/:nameOfPokemon/:typeOfImage You can use this types of image:

  • back_default
  • back_female
  • back_shiny
  • back_shiny_female
  • front_default
  • front_female
  • front_shiny
  • front_shiny_female

http://localhost:3000/pokemons/mankey/front_default

Test

# unit tests
$ yarn test

# test coverage
$ yarn test:cov

api_nest_pokemons's People

Contributors

kamilmysliwiec avatar renovate-bot avatar luedch93 avatar sacro avatar alsoicode avatar progral avatar mchelen avatar allenfang avatar beeman avatar brunnerlivio avatar maximzinovik avatar rpihlak avatar rubencodeforges avatar blazeu avatar yurykozhenov avatar dependabot[bot] avatar fanybook avatar schinvendy avatar konradlinkowski avatar jajaperson avatar elylucas avatar e-watson avatar ben-webantic avatar bashleigh avatar xorik avatar amitport avatar alexsasharegan avatar

Watchers

James Cloos avatar  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.