Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142410

Data didn't send to peer server

$
0
0

Here is my server https://github.com/bluelovers/novel-opds-now

I try to use this code for check, but it returns undefined.

/**
 * Created by user on 2020/2/2.
 */

import Gun from 'gun';
import fetch from 'cross-fetch';
import Bluebird from 'bluebird';

let id = String(2665); // some time need change this id for test or delete `radata` in this test file folder

fetch(`http://localhost:3000/file/wenku8/${id}`)
    .then(async (value) => {
        console.log(`ok, wait 3s`);

        await Bluebird.delay(3000);

        // @ts-ignore
        let gun = new Gun({
            peers: [
                "https://gunjs.herokuapp.com/gun",
                "http://nmr.io:8765/gun",
            ]
        });

        await gun.get('epub-file')
            .get('wenku8')
            .get(id)
            .then(v => console.log(`here should return { timestamp, base64 }, but`, v))
    });

When I add http://localhost:3000/gun to peer list, but it is same.


Viewing all articles
Browse latest Browse all 142410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>