Giter Club home page Giter Club logo

p5_kanap_dw_openclassrooms's Introduction

P5-Kanap - Construisez un site e-commerce en JavaScript

Backend

Le dossier back permet de faire tourner l'api contenant les données des produits.

Installation

Il suffit de se positionner dans le dossier backend avec un terminal et de saisir la commande npm install

Lancement du serveur

Il suffit de se positionner dans le dossier backend avec un terminal et de saisir la commande node start Par défaut le serveur sera lancé sur le port 3000 ( http://localhost:3000 )

Route api

Il y a 3 routes disponibles sur le serveur :

GET /api/products/

Permet de récupérer l'ensemble des produits disponibles

GET /api/products/{id}

{id} : identifiant unique d'un produit Permet de récupérer un produit par son identifiant

POST /api/products/order

Envoie une commande pour l'enregistrer La commande envoyé doit être au format JSON suivant :

{
    contact{
	    firstName: <string>,
	    lastName: <string>,
	    address: <string>,
	    city; <string>,
	    email: <string>
	},
	products: [<string>]
}

products étant un tableau d'id produit.

Frontend

Le frontend présente la partie utilisateur de l'application. Il doit être lancé avec un serveur local (live server avec vscode par exemple), et nécessite que le backend soit lancé lui aussi pour fonctionner correctement.

Config

Le fichier de config permet de définir l'adresse de base du server, avec son host, port et si un certificat ssl est utilisé ou non.

Attention, l'architecture utilisée dans cet exemple est un niveau bien supérieur aux attentes sur ce projet. Copier ce code entrainerait un fort risque de détection de plagiat en soutenance.

Training-dev

Retrouvez tous nos cours, tutos, lives et exercices sur training-dev.fr

p5_kanap_dw_openclassrooms's People

Contributors

mostuf avatar training-dev-fr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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