var express = require('express'),
	app = express(),
	router = express.Router(),
	bodyParser = require('body-parser'),
	fs = require('fs'),
	path = require('path'),
	_ = require('lodash');

app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

var port = process.env.PORT || 8080;

/*app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});*/

// different views for different reasons
// home view
app.get('/', function(req, res, next) {
	res.render('home', {});
});

app.get('/demo', function(req, res, next) {
	res.render('demo', {});
});

router.use(function(req, res, next) {
	console.log('something is happening');
	next();
});

app.set('views' ,'./public/views');

app.set('view engine', 'pug');

app.use(express.static('public'));

router.get('/contact-form', function() {
	
});

// these are the api, to submit forms with
app.use('/api', router);


app.listen(port);
console.log(`go to localhost: ${port}`);


var express = require('express'),
	app = express(),
	router = express.Router(),
	bodyParser = require('body-parser'),
	fs = require('fs'),
	path = require('path'),
	_ = require('lodash');

app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

var port = process.env.PORT || 8080;

/*app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});*/

// different views for different reasons
// home view
app.get('/', function(req, res, next) {
	res.render('home', {});
});

app.get('/demo', function(req, res, next) {
	res.render('demo', {});
});

app.get('/contact-us', function(req, res, next) {
	res.render('contact-us', {});
});

router.use(function(req, res, next) {
	console.log('something is happening');
	next();
});

app.set('views' ,'./public/views');

app.set('view engine', 'pug');

app.use(express.static('public'));

router.get('/contact-form', function() {
	
});

// these are the api, to submit forms with
app.use('/api', router);


app.listen(port);
console.log(`go to localhost: ${port}`);


add path to contact us