diff --git a/app.js b/app.js
index b96a54c..4f79ee0 100644
--- a/app.js
+++ b/app.js
@@ -25,8 +25,10 @@ var config = require('./config/database');
//mongoose.Promise = require('bluebird');
mongoose.connect(config.database);
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");
+ res.setHeader('Access-Control-Allow-Origin', '*');
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
+ res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
+ res.setHeader('Access-Control-Allow-Credentials', true);
next();
});
app.use(session({
diff --git a/bin/www b/bin/www
index 3b45ba2..df9b652 100644
--- a/bin/www
+++ b/bin/www
@@ -34,8 +34,8 @@ var credentials = {
cert: certificate,
passphrase: 'titi'
};
-var server = https.createServer(credentials, app);
-
+//var server = https.createServer(credentials, app);
+var server = http.createServer(app);
// server.setSecure(credentials);
/**
diff --git a/routes/api.js b/routes/api.js
index 1bb0a36..83a76af 100644
--- a/routes/api.js
+++ b/routes/api.js
@@ -48,7 +48,13 @@ const storage = multer.diskStorage({
}
});
-
+router.use(function(req, res, next) {
+ res.setHeader('Access-Control-Allow-Origin', '*');
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
+ res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
+ res.setHeader('Access-Control-Allow-Credentials', true);
+ next();
+});
/* GET home page. */
router.get('/', function(req, res, next) {
res.send('Express RESTful API');
diff --git a/src/app/book/book.component.html b/src/app/book/book.component.html
index 4744e9d..1b0b977 100644
--- a/src/app/book/book.component.html
+++ b/src/app/book/book.component.html
@@ -12,6 +12,10 @@
+
+
+
+
@@ -32,7 +36,7 @@
-
+