Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
13d6a876
Commit
13d6a876
authored
Jul 01, 2013
by
Tomotsugu Kaneko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'autopublish, insecure' packages and add code for security reasons.
parent
f588bcde
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
labs/architecture-examples/meteor/.meteor/packages
labs/architecture-examples/meteor/.meteor/packages
+1
-2
labs/architecture-examples/meteor/app.js
labs/architecture-examples/meteor/app.js
+27
-0
No files found.
labs/architecture-examples/meteor/.meteor/packages
View file @
13d6a876
autopublish
insecure
labs/architecture-examples/meteor/app.js
View file @
13d6a876
...
@@ -196,6 +196,33 @@ if (Meteor.is_client) {
...
@@ -196,6 +196,33 @@ if (Meteor.is_client) {
};
};
}
}
//Publish and subscribe setting
if
(
Meteor
.
is_server
)
{
Meteor
.
publish
(
'
todos
'
,
function
()
{
return
Todos
.
find
();
});
}
if
(
Meteor
.
is_client
)
{
Meteor
.
subscribe
(
'
todos
'
);
}
//Allow users to write directly to this collection from client code, subject to limitations you define.
if
(
Meteor
.
is_server
)
{
Todos
.
allow
({
insert
:
function
()
{
return
true
;
},
update
:
function
()
{
return
true
;
},
remove
:
function
()
{
return
true
;
}
});
}
//Defines functions that can be invoked over the network by clients.
Meteor
.
methods
({
Meteor
.
methods
({
clearCompleted
:
function
()
{
clearCompleted
:
function
()
{
Todos
.
remove
({
completed
:
true
});
Todos
.
remove
({
completed
:
true
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment