Intro to web development Part 2

Steven Klavins
1 min readApr 13, 2020

So now to start adding some code so we can actually see something when we access our local host, take a look at what I have below. Note with the Sinatra framework you need to restart the server each time you run the code, I will cover a workaround for this shortly.

In our app Ruby file, we have included the Sinatra framework using the module ‘base’ and two get requests formatted with the address, ‘/’ representing our root or index and ‘/rps’ representing root/rps. As I previously discussed HTTP interacts with our client by making get/post requests, we are making get requests to our local server using our client when we run this code.

Now the issue regarding having to restart our server each time we restart our code, well thankfully in this scenario we can use a gem to automate this process named shotgun.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Steven Klavins
Steven Klavins

Written by Steven Klavins

Hi, I’m Steven, most call me Steve! I’m a programmer, musician, and artist. This blog contains various tutorials and posts related to software development.

No responses yet

Write a response