Initial commit 🍀

This commit is contained in:
syuilo
2016-12-29 07:49:51 +09:00
commit b3f42e62af
405 changed files with 31017 additions and 0 deletions

21
src/db/elasticsearch.ts Normal file
View File

@ -0,0 +1,21 @@
import * as elasticsearch from 'elasticsearch';
// Init ElasticSearch connection
const client = new elasticsearch.Client({
host: `${config.elasticsearch.host}:${config.elasticsearch.port}`
});
// Send a HEAD request
client.ping({
// Ping usually has a 3000ms timeout
requestTimeout: Infinity,
// Undocumented params are appended to the query string
hello: 'elasticsearch!'
}, error => {
if (error) {
console.error('elasticsearch is down!');
}
});
export default client;