馃殌 CYBER WEEK SALE: 50% OFF on JavaScript Fundamentals 馃挭

Task #1075, Stage #2 - Mining Empire - Backend

Now, we need to import server from server.js and startServer from functions.js into index.js and actually start a server! You can start it on any free port, but I suggest using port 8080 for us to be on the same page...

August 15, 2020 路 1 min 路 Coderslang Master

Task #1075, Stage #3 - Mining Empire - Backend

Let鈥檚 add our first route to the server to be able to test it. In server.js, right below the comment add the GET /check route. The payload served on this route should be { version: '0....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1075, Stage #4 - Mining Empire - Backend

Follow up with creating the object that we will serve as a config to our Mining Empire app Create the file constants.js and export the object CONFIG from it You can take a look at the example on https://v2....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1075, Stage #5 - Mining Empire - Backend

Now that we have the CONFIG constant, we can import it into server.js and add a new route GET /config that will serve it. Implement this route and make sure it works by going to http://localhost:8080/config in the browser...

August 15, 2020 路 1 min 路 Coderslang Master

Task #1075, Stage #6 - Mining Empire - Backend

Awesome! We have the config and we can access it! Now, let鈥檚 make it functional. The easy way would be to copy and tweak the structure from https://v2.coderslang.com/evil-empire-config A bit harder approach is to write everything yourself....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1075, Stage #7 - Mining Empire - Backend

Good job! Now we move on to describing the upgrades. Upgrades is an array of objects. Each upgrade improves the performance of one or more producers. Here鈥檚 the structure of a single upgrade:...

August 15, 2020 路 2 min 路 Coderslang Master

Task #1075, Stage #8 - Mining Empire - Backend

The upgrades are done, so let鈥檚 add the achievements that the user can unlock within the game. Once again, we need an array of objects: id: a unique number which is used to identify an achievement title: a string that sets the name of the achievement description: a string that describes the achievement pictureURL: a string, an https link to the achievement picture in ....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1075, Stage #9 - Mining Empire - Backend

Our mining empire should be playable for the extended periods of time, so let鈥檚 add prestige levels. prestigeLevels is an array of objects: id: a unique number which is used to identify the prestige level title: a string that sets the name of the prestige level multiplier: a number that defines increased production on this prestige level pictureURL: a string, an https link to the prestige level picture in ....

August 15, 2020 路 1 min 路 Coderslang Master

Task #1081 - Log Promise

Fix the function printUserCount. Right now it prints to the console the string Promise { <pending> }, but it should print the number of users. This task is part of the Full-Stack JavaScript Course...

August 15, 2020 路 1 min 路 Coderslang Master

Task #1082 - Unhandled rejection

Fix the function printUserCount. It should call handleUnknownError if the Promise is rejected. This task is part of the Full-Stack JavaScript Course If you have any issues with it, you can ask for community help below the post...

August 15, 2020 路 1 min 路 Coderslang Master