flosight-api/lib/server/index.js
tenthirtyone b028dead40 Initial Commit
Changelog:
Setup & Foundation
- bcoin
- express
- mongo
- eslint
- logging

Status: Bcoin syncs over network, uses a local leveldb to store blocks and checkpoints. Block event saves data to mongo. Express endpoint for block hashes, stubbed to reply with blockhashes until mongo models are finalized.

ToDo:
Move config out of code
2017-08-02 14:51:06 -04:00

16 lines
365 B
JavaScript

const express = require('express');
const app = express();
const mongoose = require('mongoose');
const config = require('../../config/config.js');
const Block = require('../../models/block.js');
mongoose.connect(config.mongodb, {
useMongoClient: true
});
app.get('/block/:blockhash', (req, res) => {
res.send(req.params.blockhash);
});
module.exports = app;