Giter Club home page Giter Club logo

expressapi's Introduction

ExpressApi Plantilla Ecommerce con MongoDb

Deploy url

https://expressapiecommerce.azurewebsites.net/

abrir un Issues para sugerencias o ayuda

en el archivo .env ingresar la url de mongodby redis

MONGO_URL = mongodb+srv://user:passworscluster0.y2dzttg.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
REDIS_URL=redis://:[email protected]. redis-cloud.com:port

en el archivo keys secretOrKey para token y array con los roles, de este modo:

module.exports = {
  secretOrKey: "secret",
  userRoles: ["user", "manager"],
};

Requiere Redis para almacenar el carrito compra, modificar archivo /config/redis para cambiar la cadena de conexion

Endpoints

  • Usuarios al iniciar sesion o registrarse se crea el token con el role definido

    • "/api/users/": Informacion del usuario

    • "api/users/all": Obtener todos los usuarios requiere role "manager"

    • "api/users/login": Iniciar sesion

      body{ "email" : " ", "password" : " ", "name" : " ", "lastname" : " " }

    • "/api/users/registrarse": Crear cuenta enviar Json con datos segun user.model.js

  • Productos

    • "/api/productos/?" : Obtener todos los productos parametros de query para filtrar y ordenar

      • sort
      • page
      • pageSize
    • "/api/productos/:id" : Obtener producto por id

    • "/api/productos/agregar" : Agregar un producto, insertar la data requerida segun producto.model.js

    • "/api/productos/actualizar/:id" : Actualizar un producto por id, enviar en el body data actualizada del producto

    • "/api/eliminar/?id=" : Elimina un producto por id

  • Ordenes

    • "/api/ordenes/" : Obtener todas las ordenes requiere role "manager", parametros de query para filtrar y ordenar :
      • sort
      • page
    • "/api/ordenes/:id" : Obtener una orden por su Id requiere role "user"
    • "/api/ordenes/crearorden" : crear una orden requiere role "user" y enviar los datos de la orden segun orden.model.js por medio json en body
    • "/api/ordenes/actualizar/:id" : Actualizar una orden por id requiere role "manager" y enviar data actualizada por medio json
    • "/api/ordenes/eliminar/:id" : Eliminar una orden por medio de Id requiere role "manager"

expressapi's People

Contributors

dsniels avatar deepsource-autofix[bot] avatar deepsource-io[bot] avatar

Watchers

 avatar

expressapi's Issues

(JS-0128) Should not have unused variables

Description

Found variables that are declared but not used anywhere. > NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts. > Currently, we don't support variables that are not explicitly exported, > and are injected into other scripts by being included in an HTML file

Occurrences

There are 5 occurrences of this issue in the repository.

See all occurrences on DeepSource → app.deepsource.com/gh/Dsniels/ExpressApi/issue/JS-0128/occurrences/

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.