Quick update on what got done on Friday 17th January. Quiet day with client work so I was able to spend an afternoon working on it.
Naming projects has always been something I've struggled with - usually due to indecisiveness. I made a conscious decision that this wasn't going to happen in this project so I had a quick brainstorm and settled on Freelance Insights - not particularly inspired or clever, but descriptive, functional and means I can move on.
Deciding on this I could buy the domain name (see the Costs for full breakdown) and get things set up on the server.
I had managed to get the API, app and blog set up on my new server earlier in the week under one of my other random domain names so the first task was to switch everything over to the new domain names:
- and (soon - should really get a landing page up!) freelancinsights.com
Things went fairly smoothly - I made a snapshot on Hetzner so I could roll back if things went belly up, but didn't need it in the end. Woop. Maybe devops isn't so bad after all.
I had some serious trouble getting the API deployed and working with cross-domain calls earlier in the week which I eventually stumbled into getting working, rather than using actual knowledge.
When testing the API after migrating to the new domains it seemed to break. However, it turns out it didn't actually work properly earlier either!
After some Googling, I switched the Express API to use the
cookie-session package which was much simpler and actually saved the cookies. Win!
I'm going to write some more about CORS (if I can summon the will!) and how I got it working - if I actually know!
The boilerplate app I based the API on had some good OAuth handling code already there so adapting it for FreeAgent wasn't too tricky. I made some updates today so that it handles refreshing the access token when required. The API is looking good now.