mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
nova-api: no more globals
This commit is contained in:
parent
b06fb2f843
commit
b879c9976e
2 changed files with 4 additions and 2 deletions
|
@ -3,7 +3,7 @@ import Posts from "meteor/nova:posts";
|
|||
import Comments from "meteor/nova:comments";
|
||||
import Users from 'meteor/nova:users';
|
||||
|
||||
serveAPI = function(terms){
|
||||
export const servePostsApi = (terms) => {
|
||||
var posts = [];
|
||||
|
||||
var parameters = Posts.parameters.get(terms);
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { servePostsApi } from './api.js';
|
||||
|
||||
// for backwards compatibility's sake, accept a "limit" segment
|
||||
Picker.route('/api/:limit?', function(params, req, res, next) {
|
||||
if (typeof params.limit !== "undefined") {
|
||||
params.query.limit = params.limit;
|
||||
}
|
||||
res.end(serveAPI(params.query));
|
||||
res.end(servePostsApi(params.query));
|
||||
});
|
Loading…
Add table
Reference in a new issue