October 7, 2026

Refactoring The-Internet: Deploying the web app to Render

We are well on our way to place a copy of my favorite test site, The-Internet, onto its new home on Render.com, a place where developers can deploy web apps using their free tier, much like Heroku in its heyday. Sure, web apps that live on the free tier of Render takes a minute or so to spin up, but, hey, you get what you pay for!

With our last blog post, we: 
With this blog post, we will create a new account on Render, a new project, and set up a new home for The-Internet.  


What the Heck is Render?


Render is a cloud platform as a service (PaaS) that allows developers to host websites, web applications, databases, and background services without having to manage underlying server infrastructure.


"Anurag Goel founded Render in 2018, serving as CEO. His insight stemmed from cloud infrastructure complexities, driving him to create a more accessible, reliable environment for developers. Goel aimed to empower teams to deliver products faster by abstracting underlying infrastructure challenges, leveraging his previous experience".


How to Set Up Render


  • Select "Sign Up For Render" to go to https://dashboard.render.com/register
  • Select "GitHub" and log into your GitHub account, sharing your information with Render. 
  • Select to host a web service. 
  • Connect to my GitHub code repositories
  • Chose to install Render on tmaher/the-internet
Render pre-filled: 
  • The name of the project to "the-internet", the language to be "Docker", the branch to be "main". 
  • Chose the free tier, using .01 CPUs and 512 MB RAM. Free instances spin down after a period of inactivity.
  • Render had me create for my project a Render.yaml file:
services:
  - type: web
    name: the-internet-modern
    env: ruby
    buildCommand: |
      bundle config set --local without "development test"
      bundle install
    startCommand: bundle exec rackup -p $PORT -o 0.0.0.0
    envVars:
      - key: RUBY_VERSION
        value: "3.4.2"
... And it failed. It showed the message: HOST NOT PERMITTED

How To Fix Sinatra Problems

Why did going to https://the-internet-8uaj.onrender.com/ show: Host not permitted?

When I asked Google AI, it said that:

"Starting with version 4.1.0, Sinatra introduced strict, built-in security middleware called Rack::Protection::HostAuthorization. By default, this middleware blocks HTTP requests unless the accessing URL matches an allowed list (typically defaulting only to localhost). When Render routes traffic to your app through the-internet-8uaj.onrender.com, Sinatra flags it as an unrecognized hostname and throws a 403 Forbidden response with the body text 'Host not permitted'"

As a solution, it had me add to the existing server.rb file:

server.rb
class Protected < Sinatra::Base
  set :host_authorization, permitted_hosts: []
  register Sinatra::Flash
. . .
. . .
class Public < Sinatra::Base
  set :host_authorization, permitted_hosts: []
  helpers Sinatra::Cookies


As soon as I made the changes, and pushed them to GitHub. They automatically deployed to the website.. which took a while to load up after going to https://the-internet-8uaj.onrender.com/. 


After this brief interlude. going to https://the-internet-8uaj.onrender.com/login we see ... a Login Page!


So now, when I run a Playwright test framework, and I have it hooked up to test versus The-Internet / Login, I just need to remember to swap out the URL and add some time for the page to load. 

Feel free to use the website if you would like! 

Happy Testing!

-T.J. Maher
Software Engineer in Test

BlueSky | YouTube | LinkedIn | Articles

No comments:

Post a Comment