Code Monkey home page Code Monkey logo

node-api-restful's Introduction

Aplicação RESTful com Node.js

Os seguintes módulos e ferramentas foram utilizados para o desenvolvimento da aplicação:

Postman: https://www.getpostman.com/

Nodemon: https://github.com/remy/nodemon

Restify: https://github.com/restify/node-restify

Restify(errors): https://github.com/restify/errors

Knexjs: https://github.com/tgriesser/knex / http://knexjs.org

Instalação e execução:

E necessário ter previamente instalado Node ˆ8.x e o MySQL

Insira a estrutura utilizada no MySQL

CREATE DATABASE `db`;
USE `db`;

CREATE TABLE `rest` (
  `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `rest` VALUES(1, 'João Pessoa');
INSERT INTO `rest` VALUES(2, 'Pessoa joão');

Configure a conexãono arquivo index.js.

var knex = require('knex')({
  client: 'mysql',
  connection: {
    host : 'localhost',
    user : 'root',
    password : '',
    database : ''
    }
});

Instalação:

 1 cd Node-API-RESTful
 2 npm install
 3 npm run dev
 disponível: http://localhost:3000

node-api-restful's People

Watchers

 avatar  avatar

Forkers

srqway

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.