Skip to content

Commit

Permalink
Setup Express API
Browse files Browse the repository at this point in the history
  • Loading branch information
15Dkatz committed Sep 27, 2022
1 parent e926c95 commit a80a085
Show file tree
Hide file tree
Showing 3 changed files with 2,989 additions and 139 deletions.
14 changes: 14 additions & 0 deletions index.js
@@ -0,0 +1,14 @@
const express = require('express');
const Blockchain = require('./blockchain');

const app = express();
const blockchain = new Blockchain();

app.get('/api/blocks', (req, res) => {
res.json(blockchain.chain);
});

const PORT = 3000;
app.listen(PORT, () => {
console.log(`listening at localhost:${PORT}`);
});

0 comments on commit a80a085

Please sign in to comment.