Giter Club home page Giter Club logo

api-cadastro-node-mongo-heroku's Introduction

description
Sistema de cadastro de usuários.

Node + express + mongodb

Projeto

O presente projeto tem por finalidade criar uma api com os endpoints de registro , login e busca e um usuário

Arquitetura

A arquitetura da api teve influência do MVC, apesar de não haver o view, foi criado um model para os métodos e o controller paras as rotas.

> config
    > auth.json
    > index.js
    > mongo.js
> src
    >controllers
        >authconrollers.js
        >usercontrollers.js
    >middleware
        >tokenverify.js
    >models
        >token.js
        >user.js
        >userdata.js
        >userschema.js

config

Arquivos de inicialização e de conexão com o banco

controllers

rotas de autenticação/busca e rotas de registro e login

middleware

lógica de verificação do token

models

lógicas da regra de negócio

endpoints

POST registrar

http://localhost:3000/user/register

{
	"nome": "developer",
	"email":"[email protected]",
	"senha":"1234",
	"telefones":[
			{
				"numero":"998766544",
				"ddd":"21"
			},
			{
				"numero":"999966544",
				"ddd":"21"
			}
		]
}

GET logar

http://localhost:3000/user/login

{
	"email":"[email protected]",
	"senha":"1234"
}

GET buscar

http://localhost:3000/auth/searchuser

header token autentication + parametro id

api-cadastro-node-mongo-heroku's People

Contributors

tvitor avatar

Watchers

 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.