-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test commit to see if it works on vps
- Loading branch information
Shangaman
committed
Nov 4, 2022
1 parent
8779ec3
commit 33367dd
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const express = require('express'); | ||
const fetch = require('node-fetch'); | ||
|
||
const app = express() | ||
const port = 3000 | ||
|
||
fetch('http://127.0.0.1:51473/', { | ||
method: 'POST', | ||
headers: { | ||
'content-type': 'text/plain;', | ||
'Authorization': 'Basic ' + btoa('masternode_test:p') | ||
}, | ||
body: '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": [] }' | ||
}).then(res => res.text()) | ||
.then(text => console.log(text)); | ||
|
||
/* | ||
fetch('https://google.com') | ||
.then(res => res.text()) | ||
.then(text => console.log(text)); | ||
*/ | ||
|
||
|
||
app.get('/', (req, res) => { | ||
res.send('Hello World!') | ||
}) | ||
|
||
app.get('/porcodio', (req, res) => { | ||
res.send('dio porco World!') | ||
}) | ||
|
||
app.listen(port, () => { | ||
console.log(`Example app listening on port ${port}`) | ||
}) |