This is a simple Node.js application that is used to help train new Render employees about how users interact with our product.
The app only does a few things:
- runs an http server that returns information about the environment where it's run
- tracks a hit counter via redis, if given a connection to a redis instance
- Have a running redis instance
- Install dependencies with
npm install
- Configure your environment so the
REDIS_URL
environment variable has the URL of your redis instance. - Start the server with
npm start
Well, that's where the fun begins!
Imagine yourself as founder of a new and exciting tech product company. You have a local demo of your product, but don't know anything about infrastructure. You just want your app to run, hopefully scalably, without having to think about it much.
Your task is to finish as much as you can of the below. Try using Render's public docs if you run into challenges, but ask the person leading this session if you get stuck and need help.
- Fork this repo to your own account.
- Get the Node service running on Render as quickly as possible.
- Put
npm install
as the build command - Put
npm start
as the start command
- Put
- Set up a Redis instance on Render and configure it to be used by the service.
- Configure Render to automatically deploy new copies of your app whenever you make PRs to the repo
- Make a PR that improves the page in some way (at minimum, changes to your name!). Make sure you view the Render preview of that change before merging the change to production.
Extra credit choose-your-own-adventure options:
- Take the configuration you've done via the Render Dashboard and instead use Render's Infrastructure-as-Code product (Blueprints) to manage your services in your git repo.
- Configure a custom domain so your websie doesn't run on {something}.onrender.com
- Set up a background task that automatically resets (or increments) the hit counter on a schedule
- Frontend: make the sample page prettier, and submit the changes back as a PR to the original repo.
- Ambitious: separate the html content from the dynamic hit counter data, and build an API endpoint to fetch the hit counter state. Move the html content to a static site hosted by a CDN for performance.