Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express=require ('express');
- var bodyParser = require('body-parser');
- var path = require ('path');
- var sql = require('mssql');
- var app = express();
- const config = {
- user: 'sa',
- password: 'password',
- server: 'localhost\SQLEXPRESS', // You can use 'localhost\instance' to connect to named instance
- database: 'pcgdb',
- options: {
- encrypt: false // Use this if you're on Windows Azure
- }
- };
- const request = new sql.Request()
- //view engine
- app.set('view engine', 'ejs');
- app.set('views', path.join(__dirname, 'views'))
- app.use(bodyParser.json());
- app.use(bodyParser.urlencoded({extended: false}));
- app.get('/',function(req,res){
- res.render('index')
- });
- app.get('/new_project', function(req, res) {
- function(data,err){
- var data= request.query('select Project_Type_Desc from Project_Type');
- //not sure what should go here !!
- app.listen(3000,function(){
- console.log ('server listening on port 3000')
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement