Guest User

Untitled

a guest
Apr 8th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. [
  2. {
  3. "IDUSER": 1,
  4. "NAME": "Teste ",
  5. "EMAIL": "teste@teste ",
  6. "USERNAME": "teste ",
  7. "PASSWORD": "123456 "
  8. }
  9. ]
  10.  
  11. USE [gajokai]
  12. GO
  13.  
  14. /****** Object: Table [dbo].[USUARIO] Script Date: 08/04/2018 23:42:56 ******/
  15. SET ANSI_NULLS ON
  16. GO
  17.  
  18. SET QUOTED_IDENTIFIER ON
  19. GO
  20.  
  21. CREATE TABLE [dbo].[USUARIO](
  22. [IDUSER] [int] IDENTITY(1,1) NOT NULL,
  23. [NAME] [nchar](50) NOT NULL,
  24. [EMAIL] [nchar](50) NOT NULL,
  25. [USERNAME] [nchar](30) NOT NULL,
  26. [PASSWORD] [nchar](30) NOT NULL,
  27. CONSTRAINT [PK_USER] PRIMARY KEY CLUSTERED
  28. (
  29. [IDUSER] ASC
  30. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  31. ) ON [PRIMARY]
  32. GO
  33.  
  34. const mssql = require('mssql');
  35. const knex = require('knex')({
  36. client: 'mssql',
  37. connection: {
  38. server : '127.0.0.1',
  39. user : 'sa',
  40. password : '123456',
  41. database : 'gajokai',
  42. options: {
  43. port: 1433
  44. }
  45. }
  46. });
  47.  
  48. module.exports = knex;
  49.  
  50. const express = require('express');
  51. const router = express.Router();
  52.  
  53. const db = require('../configs/db/connectionDB');
  54.  
  55. /* GET home page. */
  56. router.get('/', function(req, res, next) {
  57.  
  58. db.select().table('USUARIO').then(function(todos){
  59. res.send(todos);
  60. })
  61.  
  62. });
  63.  
  64.  
  65. module.exports = router;
Add Comment
Please, Sign In to add comment