iron-router

subdomain support in meteor (like with slack - http://team.slack.com)

半城伤御伤魂 提交于 2019-12-02 21:25:11
subdomain support in meteor (like with slack - http://team.slack.com ) As in slack my app users can create their own subdomains (unique) and depending on the subdomain the data should be loaded, and around this the application would be proceeded. I can use something like http://slack.com?team=TeamName , but i think the subdomain would be much clean and better. Any suggestions/pointers. Thanks. Taken from the Meteor forums . Using a DNS wildcard to point *.example.com to my app server, I have this in the client code: var hostnameArray = document.location.hostname.split( "." ); if (

Multiple subscriptions in iron router

a 夏天 提交于 2019-12-02 19:37:59
I have been working on an application using a comment function. That results in having to subscribe to both a collection which the comments are made on and the comments collection itself. Now it looks like this: <template name="bookView"> {{> book}} {{> comments}} </template> this.route('book', { path: '/book/:_id', template: 'bookView', waitOn: function() { return Meteor.subscribe('book');}, action: function () { if (this.ready()){ this.render(); } else this.render('loadingTemplate'); }, data: function() {return Books.findOne(this.params._id);} }); But now I would like to load all comments

How to use yield and Iron-router?

谁都会走 提交于 2019-12-02 18:31:15
问题 So I am trying to do a basic meteor app at the moment.. here are the three files. router.js: Router.configure({ layoutTemplate : 'layout', loadingTemplate : 'loading', notFoundTemplate : 'notFound' }); Router.route("/", { name : "homeIndex", data : function() { return { message : "Welcome to the Rocket Shop" } } }); index.html: <template name="homeIndex"> <h1>{{message}}</h1> </template> layout.html: <template name="layout"> {{> nav}} <div class="container"> {{>yield}} </div><!-- /.container

Cannot add package iron router for meteor on windows 8.1 pro

独自空忆成欢 提交于 2019-12-02 13:31:35
I installed meteor on windows from http://win.meteor.com/ . I was trying to install iron router package for meteor on windows 8.1 by downloading following repositories git clone https://github.com/tmeasday/meteor-router.git After downloading i renamed the folder to iron-router. Then i downloaded other repositories git clone https://github.com/tmeasday/meteor-page-js-ie-support.git git clone https://github.com/tmeasday/meteor-HTML5-History-API.git git clone https://github.com/EventedMind/blaze-layout.git updated sub modules using git submodule update –-init for meteor-HTML5-History-API meteor

How to respond server-side to routes using Meteor and Iron-Router?

蹲街弑〆低调 提交于 2019-12-02 12:32:56
问题 I'm sending a file from client-side to server side using XHR: $(document).on('drop', function(dropEvent) { dropEvent.preventDefault(); _.each(dropEvent.originalEvent.dataTransfer.files, function(file) { // ... xhr.open('POST', Router.routes['upload'].path(), true); xhr.send(file); }); }) Now I want to respond to this POST server-side and save the file to disk. The docs only seems to talk about handling things client-side; I don't even know how to get a hook on the server-side. All I have for

How to use yield and Iron-router?

☆樱花仙子☆ 提交于 2019-12-02 10:10:32
So I am trying to do a basic meteor app at the moment.. here are the three files. router.js: Router.configure({ layoutTemplate : 'layout', loadingTemplate : 'loading', notFoundTemplate : 'notFound' }); Router.route("/", { name : "homeIndex", data : function() { return { message : "Welcome to the Rocket Shop" } } }); index.html: <template name="homeIndex"> <h1>{{message}}</h1> </template> layout.html: <template name="layout"> {{> nav}} <div class="container"> {{>yield}} </div><!-- /.container --> </template> When I go to localhost:3000 after starting the app I get a long stacktrace in my

Installation issues with iron-router (newest) on Windows 7 x64 (Meteor 0.8.3)

≡放荡痞女 提交于 2019-12-02 06:09:54
问题 I'm attempting to install (via cloned repository) 'iron-router' for my Meteor project in Windows 7. ( Repo: https://github.com/EventedMind/iron-router ) The output is the following: While building package `iron-router`: error: no such package: 'reactive-dict@1.0.0' error: no such package: 'deps@1.0.0' error: no such package: 'underscore@1.0.0' error: no such package: 'ejson@1.0.0' error: no such package: 'jquery@1.0.0' error: no such package: 'ui@1.0.0' error: no such package: 'iron' error:

Is it possible to define iron-router server side routes that respond to certain HTTP actions?

十年热恋 提交于 2019-12-02 02:48:18
问题 I have a basic server side route defined in iron-router like: this.route('foo', { where: 'server', path: '/foo', action: function() { // handle response } }); This appears to respond to a request at "/foo" with any HTTP action, i.e. a GET to "/foo" and a POST to "/foo" both trigger this route. Is it possible to limit the response to a GET action, and let the other actions be notFound? Similarly, is it possible to have a GET to "/foo" handled by one route, and a POST to "/foo" handled by

Is it possible to define iron-router server side routes that respond to certain HTTP actions?

自古美人都是妖i 提交于 2019-12-01 23:48:22
I have a basic server side route defined in iron-router like: this.route('foo', { where: 'server', path: '/foo', action: function() { // handle response } }); This appears to respond to a request at "/foo" with any HTTP action, i.e. a GET to "/foo" and a POST to "/foo" both trigger this route. Is it possible to limit the response to a GET action, and let the other actions be notFound? Similarly, is it possible to have a GET to "/foo" handled by one route, and a POST to "/foo" handled by another? You can definitely check the method and only respond if it's the one you want, e.g., like this:

Aborting navigation with Meteor iron-router

风流意气都作罢 提交于 2019-12-01 01:54:28
问题 I have a (client-side) router in a Meteor app, and links using the {{pathFor}} helper. I am setting a dirty flag in the Session when the user changes a form field, and I want to trigger a warning and allow the user to stop navigating away from the page if the flag is set, basically like an onunload handler. I've tried to do this with: Router.onBeforeAction(function(pause) { var self = this; if (!this.ready()) { return; } if(Session.get('dirty')) { if(!confirm("Are you sure you want to