Up and Running with Deno

nader dabit
Instructornader dabit
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 3 years ago

In this video, we start by going to Begin.com and creating a new Deno app. We then clone the repo, inspect the code, and modify the response from HTML to JSON data. Next, we deploy the updates in an automated CI / CD process by merging the updates to our master GitHub branch.

Nader Dabit: [0:01] We'll get started by going to begin.com. Here, we'll go ahead and sign up for a new account. Then, we'll authorize using GitHub.

[0:14] Once in the dashboard, we can now click on Create new app. Here, we'll choose Deno and then choose the Hello World example app. We'll give the app a name and then click Create Hello World app. Now the app will begin deploying and we can go ahead and click on the link to our GitHub repo to view the code.

[0:51] Once the initial deployment is done, we can click on Staging to view the live app.

[1:01] Next, we'll go back to GitHub and clone the repository. We'll change into the new directory and open the project in our text editor. Here, we'll open src/index.ts. As of now, the response body is set to some stringified HTML.

[1:24] For the return value in the function, we return headers as well as the body. You'll also see that in the boilerplate, we have a couple of other example responses. Let's now update the response to return some JSON data. To do so, we'll update the body to return an object and the object will give it a message field of "Hello World."

[1:47] Next in the function handler, we'll update the headers content type to be application/json. For the body, we'll return the stringified version of the body. To deploy these changes, we can push the updates to GitHub to kick off a new deployment.

[2:20] In the begin dashboard, you should see the staging branch undergoing a new build. Once the build is completed and we update, we should now see the stringified data.

~ an hour ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today