adding cors
This commit is contained in:
0
def/content.js
Normal file
0
def/content.js
Normal file
8
def/group.js
Normal file
8
def/group.js
Normal file
@@ -0,0 +1,8 @@
|
||||
User = require("./User.js")
|
||||
|
||||
class Gropu extends User {
|
||||
constructor(){
|
||||
super()
|
||||
this.isGroup = true;
|
||||
}
|
||||
}
|
||||
14
def/user.js
Normal file
14
def/user.js
Normal file
@@ -0,0 +1,14 @@
|
||||
class User {
|
||||
constructor(json){
|
||||
this.username = 'aeroreyna';
|
||||
this.following = [];
|
||||
this.lastUpdate = new Date();ß
|
||||
this.newsFeedCache = [];
|
||||
this.isGroup = false;
|
||||
}
|
||||
|
||||
newPost(){}
|
||||
newComment(){}
|
||||
newReaction(){}
|
||||
|
||||
}
|
||||
6
index.js
6
index.js
@@ -10,6 +10,12 @@ app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
app.use(cookieParser());
|
||||
|
||||
app.use(function(req, res, next) {
|
||||
res.header("Access-Control-Allow-Origin", "*"); // update to match the domain you will make the request from
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
next();
|
||||
});
|
||||
|
||||
const bcrypt = require('bcrypt');
|
||||
const crypto = require('crypto');
|
||||
const DB = require("./mongoDB.js");
|
||||
|
||||
Reference in New Issue
Block a user