Code Monkey home page Code Monkey logo

quiz-2's Introduction

Quiz #2 - API CRUD

Usted ha sido contratado para generar en servicio de API para el siguiente esquema de base de datos. La idea fundamental es generar las acciones típicas como lo es, el CRUD. Una de las condiciones propuesta por el cliente, es que se utilice el uso de json tokens para seguridad.

Requerimientos:

  • Utilice algún lenguaje de servidor visto en clase
  • Puede usar base de datos relacionales o no relaciones
  • Debe contener json tokens
  • Debe contener la arquitectura MVC (Controlador,Router,Model)

Docs

run

npm install
npm run dev

Acccess

Create a file .env and add this

PASSWORD=MWtDvbWzpB1g3gYG
DBNAME=api-crud
TOKEN_SECRET=secret_key

You won't need an access token to add new users neither to login, however you will need the access token to perform any other action CRUD. To get the access token you have to use the /login route with the username and password in the body post request (using postman)

Routes

The API was developed with MongoDB, these are the collections:

  • usuarios
  • temas
  • profesores
  • cursos
  • practicas
  • curso_practicas

CRUD

Create user /usuarios

LogIn (to get the access token) /login

To perform the other actiones CRUD, just use the same route with the corresponding collection name:

Create (POST) /<collection_name>

Get all (GET) /<collection_name>

Update (PUT) /<collection_name>/id

Delete (DELETE) /<collection_name>/id

quiz-2's People

Contributors

angel-villalobos-p avatar

Watchers

 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.