Guest User

Untitled

a guest
Jul 29th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. var bitcoinapi = require('bitcoin-node-api');
  2. var express = require('express');
  3. var app = express();
  4. var port =3000;
  5. //Username and password relate to those set in the bitcoin.conf file
  6.  
  7. var wallet = {
  8. host: 'localhost',
  9. port: 18332,
  10. user: 'test',
  11. pass: 'test123'
  12. };
  13.  
  14. bitcoinapi.setWalletDetails(wallet);
  15. bitcoinapi.setAccess('default-safe'); //Access control
  16. app.use('/bitcoin/api', bitcoinapi.app); //Bind the middleware to any chosen url
  17.  
  18. app.listen(3000);
  19. console.log('server is running at port ' +port);
Add Comment
Please, Sign In to add comment