Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "IDUSER": 1,
- "NAME": "Teste ",
- "EMAIL": "teste@teste ",
- "USERNAME": "teste ",
- "PASSWORD": "123456 "
- }
- ]
- USE [gajokai]
- GO
- /****** Object: Table [dbo].[USUARIO] Script Date: 08/04/2018 23:42:56 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- CREATE TABLE [dbo].[USUARIO](
- [IDUSER] [int] IDENTITY(1,1) NOT NULL,
- [NAME] [nchar](50) NOT NULL,
- [EMAIL] [nchar](50) NOT NULL,
- [USERNAME] [nchar](30) NOT NULL,
- [PASSWORD] [nchar](30) NOT NULL,
- CONSTRAINT [PK_USER] PRIMARY KEY CLUSTERED
- (
- [IDUSER] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
- GO
- const mssql = require('mssql');
- const knex = require('knex')({
- client: 'mssql',
- connection: {
- server : '127.0.0.1',
- user : 'sa',
- password : '123456',
- database : 'gajokai',
- options: {
- port: 1433
- }
- }
- });
- module.exports = knex;
- const express = require('express');
- const router = express.Router();
- const db = require('../configs/db/connectionDB');
- /* GET home page. */
- router.get('/', function(req, res, next) {
- db.select().table('USUARIO').then(function(todos){
- res.send(todos);
- })
- });
- module.exports = router;
Add Comment
Please, Sign In to add comment