This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isClient) { | |
Samples = new Mongo.Collection('samples'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isClient) { | |
Samples = new Mongo.Collection('samples'); | |
Template.hello.onCreated(function () { | |
var self = this; | |
self.autorun(function () { | |
self.subscribe('REST2DDP', 'sample'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title>meteor-rest2ddp</title> | |
</head> | |
<body> | |
{{> hello}} | |
</body> | |
<template name="hello"> | |
<ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isServer) { | |
Threads.allow({ | |
insert: function (userId, doc) { | |
if(!userId) | |
throw new Meteor.Error('Unauthorized', 'Please login before perform an action'); | |
check(doc.title, String); | |
if (doc.owner && doc.owner != userId) | |
throw new Meteor.Error('No permission', 'Can\'t create a thread in the name of other'); | |
doc.owner = userId; | |
doc.createdAt = new Date(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isServer) { | |
Threads.allow({ | |
remove: function (userId, doc) { | |
if(!userId) | |
throw new Meteor.Error('Unauthorized', 'Please login before perform an action'); | |
return result = doc.owner === userId; | |
} | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
'Threads.create': function (title) { | |
if (!this.userId) | |
throw new Meteor.Error('Unauthorized', 'Please login before perform an action'); | |
check(title, String); | |
Threads.insert({ | |
title: title, | |
owner: this.userId, | |
createdAt: new Date(), | |
updatedAt: new Date() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
'Threads.delete': function (threadId) { | |
if (!this.userId) | |
throw new Meteor.Error('Unauthorized', 'Please login before perform an action'); | |
check(threadId, String); | |
Threads.remove({ | |
_id: threadId, | |
owner: this.userId, | |
}); | |
return { message: 'Threads.delete OK' }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2" | |
services: | |
caddy: | |
image: abiosoft/caddy:latest | |
container_name: caddy | |
ports: | |
- "80:80" | |
- "443:443" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
furyform.com: | |
image: furyform:latest | |
build: ../furyform.com | |
container_name: furyform.com | |
environment: | |
- "NODE_ENV=production" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2" | |
services: | |
caddy: | |
image: abiosoft/caddy:latest | |
container_name: caddy | |
ports: | |
- "80:80" | |
- "443:443" |