lighthouse.js/server/controllers/lighthouse.js
Fillerino e9ff812273 Added importer as a module of the API server, importing now works.
Added importer as a module of the API server which cleans up some mess.
Fixes 
2017-08-17 12:06:24 +02:00

41 lines
840 B
JavaScript

import 'babel-polyfill';
import { sync, getStats } from '../utils/importer';
// import elasticSearch from 'elasticsearch';
/* const eclient = new elasticSearch.Client({
host: 'http://elastic:changeme@localhost:9200',
log : 'info',
}); */
class LighthouseControllers {
/* eslint-disable no-param-reassign */
// Start syncing blocks...
startSync () {
sync(200000);
}
/**
* Search api here
* @param {ctx} Koa Context
*/
async search (ctx) {
ctx.body = 'Search...';
}
/**
* Info about the api here
* @param {ctx} Koa Context
*/
async info (ctx) {
ctx.body = 'Info...';
}
/**
* Status of the api here
* @param {ctx} Koa Context
*/
async status (ctx) {
ctx.body = getStats();
}
/* eslint-enable no-param-reassign */
}
export default new LighthouseControllers();