Have you considered implementing an API endpoint instead? You could use picker, for example, and then query the collection and write the json to the response.
You could also just use publish normally and then construct a JSON object on the client, and render it using code formatting if your application is higher-level.
var Api = new Restivus({
useDefaultAuth: true,
version: 'v1',
});
Api.addRoute('json', {authRequired: false}, {
get: function () {
var data;
// build your json in data with a collection query and JSON.stringify
// if you have circular reference use https://www.npmjs.com/package/json-stringify
return data
},
});
I used to use Picker, but the author of Picker (and a lot of other really great packages) has retired from Meteor. I would use a different package, for example Restivus mentioned by @lc3t35, or you could use simple rest, or express or something. Picker worked for me, but it’s not being maintained IIRC.
Hi, would it still be possible to upload a JSON file to an IP address? I have the initial issue and don’t need to write the JSON in response as the data is handled on the other end. How would one do this? I’m rather new to this all. I have a JSON file that I’d like to upload to a static IP.