/my-first-API-countries

For this exercise i have to create my first API

Primary LanguageJavaScript

. . Express.

Hits.

my-first-API-countries

This project goal was to realize my first API


Requirements

Node

Install

$ git clone https://github.com/revolalex/my-first-API-countries
$ install nodeJS
$ don't forget the modules :
    - body-parser
    - express
    - fs
    - jsonfile
    - nodemon

Running the project

$ npm start
or
$ node server.js

Screenshots:

Looking for all the countries using euro currencies: Capture d’écran 2020-07-19 à 17 33 38

vscode: Capture d’écran 2020-07-19 à 17 32 03

Structure:

  • model folder contains Classes
  • data folder the json files
  • utils all the function
  • routes all the routes

API end points:

http://localhost:8080/currencies/ + the currencies
==> example for find all the countries using euro currencies: http://localhost:8080/currencies/eur

http://localhost:8080/country/ + the country
==> example for all the information of France: http://localhost:8080/country/france

http://localhost:8080/regions/ + the region
==> example for find all the countries inside Asia region : http://localhost:8080/regions/Asia

etc...

What i praticed, learn:

  • learned how to create an API
  • learned buid and use Classe
  • learned to stucture a project
  • learned how import, export
  • learned what is a middleware
  • praticed CRUD : - post => Create. - get => Read. - put => Update (replace). - delete => Deleter.
  • praticed error management
  • praticed capital insensitive
  • I found this project very interesting, it allowed me to learn a lot, and finally I had a lot of fun while carrying it out.

Contact