Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const bodyParser = require('body-parser');
- const app = express();
- var sql = require('mssql');
- app.use(bodyParser.json());
- app.use(bodyParser.urlencoded({ extended: false }));
- app.all("/*", function (req, res, next) {
- res.header('Access-Control-Allow-Origin', '*');
- res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
- res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With');
- next();
- });
- app.listen(1433, function () { console.log('Example app listening on port 1433!') })
- var config = {
- server: "T21DOPD1",
- database: "ARGYLE_COMPARE",
- user: "dop_adm",
- password: "dopadm",
- port: 1433
- };
- app.post('/ping', function (req, res) {
- res.send(res.body);})
- this.appService.http.post('http://localhost:1433/ping', getAll, { headers: Headers })
- .subscribe(data => {
- console.log(data), (err) => console.error("Failed! " + err);
- })
Add Comment
Please, Sign In to add comment