Last year, I posted how to include a .NET API into WordPress using a custom PHP plugin using a free MySqlServer database as a backend. It worked and works great – but admittedly, I slack on renewing my “free” credentials and the demo kept going down. This week, I finally had the time to set up my own MySql database server for roughly $15 a year. Yep, a year.
I’ve gathered the resources, from getting your own cheap Virtual Private Server and where, to the tutorials I used and the notes I took during setup, to deployment on Azure.
Getting a Cheap VPS
Black Friday is one of my favorite times to shop online for random hosting deals!! The past couple years, my fave to hunt for are “low-end vps” deals. Why? Well, it’s your own server to put any Linux distro you want on it, control and learn from, destroy, rebuild, and use it however you want. Whats not to love? Oh – right it’s cheap, and therefore a bit unstable. Some companies appear and disappear overnight, I wouldn’t consider your data absolutely not guaranteed to disappear overnight, etc. For side projects and learning purposes, though, it’s great!
I have used two now that have stayed very reliable the past couple of years:
It’s absolutely unholy. .NET Standard with a WordPress front end!? Yes, it’s possible. This odd concoction happened when the front-end developer hired claimed he could consume/operate his design around any language, but actually could only produce WordPress websites. My solution was to use a .NET Core API on top of our product database (MSSQL) and then write my own PHP WordPress Plugin that would list products by product line and then another plugin to display the products clicked in that product line. All products are maintained in another .NET Core app that allows for the products to be centralized in one spot while the front end design can be just about anything.
To walk through how I did this, I’ll start with the creation of the .NET Core API.