Cleaned up the copied project & got the Google authentication working. A lot of work still needs to be done to add content and allow only certain users access.
This commit is contained in:
@@ -5,8 +5,18 @@
|
||||
*/
|
||||
|
||||
try {
|
||||
let settingsFile = process.env.SETTINGS;
|
||||
let settings = JSON.parse(Assets.getText(settingsFile));
|
||||
let settings = Assets.getText('settings.json');
|
||||
|
||||
if(settings) {
|
||||
try {
|
||||
settings = JSON.parse(settings);
|
||||
}
|
||||
catch(err) {
|
||||
console.error("Failed to load the /private/settings.json file as a JSON object.");
|
||||
console.error(err);
|
||||
settings = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (settings) {
|
||||
ServiceConfiguration.configurations.upsert({
|
||||
@@ -24,4 +34,17 @@ try {
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
ServiceConfiguration.configurations.upsert(
|
||||
{ service: 'google' },
|
||||
{
|
||||
$set: {
|
||||
clientId: '651343079360-hm5vvji109lphnavft8vej5pp1ruek5q.apps.googleusercontent.com',
|
||||
loginStyle: 'popup',
|
||||
secret: 'VAQFr6UBkZ0ZMQJ7tb471BmW'
|
||||
}
|
||||
}
|
||||
);
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,39 @@
|
||||
import '../imports/api/';
|
||||
import './google-oauth.js';
|
||||
|
||||
import url from 'url';
|
||||
//import './google-oauth.js';
|
||||
import connectRoute from 'connect-route';
|
||||
|
||||
// Got the below code from:
|
||||
// https://docs.meteor.com/packages/webapp.html
|
||||
WebApp.connectHandlers.use(connectRoute((router) => {
|
||||
router.get('/ping', (req, res, next) => {
|
||||
//TODO: Change ping / pong to something appropriate for a browser plugin reporting user/machine data and requesting updates.
|
||||
res.end("pong");
|
||||
});
|
||||
}));
|
||||
/* Did not work at all.. not sure why.
|
||||
let WebSocketServer = require("ws").Server;
|
||||
//var wss = new WebSocketServer({ port: env.PORT });
|
||||
let wss = new WebSocketServer({host: '192.168.3.101', port: 3001});
|
||||
|
||||
console.log("Starting WS");
|
||||
|
||||
wss.on("connection", function (ws) {
|
||||
console.log("WS Open");
|
||||
|
||||
ws.on("message", function(data) {
|
||||
console.log(data);
|
||||
ws.send("Pong");
|
||||
}).on("error", (err) => {
|
||||
console.log(err);
|
||||
})
|
||||
}).on('error', (err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
// const net = require('net');
|
||||
//
|
||||
// const server = net.createServer((socket) => {
|
||||
// socket.on('data', (data) => {
|
||||
// console.log(data.toString());
|
||||
// socket.write("Pong");
|
||||
// });
|
||||
// }).on('error', (err) => {
|
||||
// console.error(err);
|
||||
// });
|
||||
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user