OSD 600 LAB 6

OSD 600 LAB 6

in this week's lab, I am asked to set up Telescope as develop mode on my machine and update my urlStateschecker to check posts' url from Telescope server. 

Setting up telescope

It's not too difficult for me to set up Telescope on my machine because I already installed Window Linux subsystem, Ubuntu, and Docker for my preview repository. I am using Window home system, I guess it's the most difficult version to set up Telescope. I glad that I suffered it already when I tried to contribute do some repository on Github. 

However, I found a "bug" from Gatsby Develop. When I tried to start the Gatsby dev serve "npm run develop", it always stucks at the first time. When I cancel it and rerun, it works. When I tried to google the bug, I found that it is an open issue (https://github.com/gatsbyjs/gatsby/issues/25216) in Gatsby repository since Jun 22. 

Check Links in Telescope Posts

I choose the easiest way which is adding some code to interact with the local Telescope server.  I only add below code and  an argument "telescope" to process this function.

const checkTelescope = () => {
    request("http://localhost:3000/posts"function (errorresponsebody){
        let obj = JSON.parse(body);
        for (let i = 0i < 10i++){
            let url = "http://localhost:3000" + obj[i].url;
            sendRequest(url);
        }
    });
}

I downloaded all the posts from localhost:3000, then check the first 10 posts using my function sendRequest.

 

I created a Gist with git diff right after I finished my coding. 


Comments

Popular posts from this blog

My PR for release 0.3 External Project

OSD600 Lab8

OSD600 -- Release 0.4.1 -- Choose Project and issues