Giter Club home page Giter Club logo

back-hospital-mean's Introduction

AdminPRO Backend

Instalación y Ejecución

 npm install
 npm run server o nodemon index.js

Instalar paquetes iniciales

 npm init -y
 npm i express --save
 npm i express-validator
 npm i bcryptjs
 npm i cors
 npm i jsonwebtoken
 npm i express-fileupload
 npm install uuid

Creación de variables de Entorno

 npm i dontenv

Crear un archivo .env y especificar las siguientes variables:

  • PORT=3000
  • DB_CNN=mongodb+srv://<username>:<password>@cluster0.o7ft6.mongodb.net/<testbd>

Creación de Modelo

Ejemplo: models/users.js

 const { Schema, model } = require("mongoose");

 const userSchema = new Schema({
      name:{ type: String, require: true },
 })

 module.exports = model("Users", userSchema);

Creación de Controlador

Ejemplo: controllers/user.js

 const getUsers = (req, res) => {
 res.json({
      ok: true,
      users: [],
      });
 };

 module.exports = { getUsers };

Creación de Ruta

Ejemplo: routes/users.js

 const { Router } = require("express");
 const { getUsers } = require("../controllers/users");
 const router = Router();

 router.get("/", getUsers);
 module.exports = router;

back-hospital-mean's People

Contributors

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