Mark Johnson

    Building this site: Part 2 - Server side logic

    Wednesday 20th May, 2020 - 1 min read

    I started adding APIs to the site to populate information such as my recent runs on Strava. I found some of these calls needed to be server side to hide credentials, and I wanted to save these calls to a database as new values only needed to be fetched from the API on a weekly or monthly basis.

    I didn’t understand how to combine the front-end site (which I’d already built) with some server logic. Luckily I came across this article that outlined how to use your own server with Gatsby, ExpressJS and NGINX.

    I followed the article step by step, and before I knew it I had my server code running with forever start server.js, configured with nginx, and with the static site serving up content dynamically from the server.

    Read more

    Click here to read Part 3 - Adding dark mode.

    Click here to see an overview of all web-dev articles related to this site.


    Enjoyed this post? ❤️

    Subscribe by email or RSS.



    Contact