I watched through all of David’s videos today and as expected, they were great. There really are some fantastic YouTubers sharing their knowledge for free, which is so useful; I’ll have to do a post about that soon. Ayyway, let’s talk through some of the things that happened today with my new project.
Getting WAMP set up on Windows is quite straight forward. Click, click, next – that kind of thing. Take a look at my article about setting up a hard shortcut plus David’s videos go through the set up for getting Apache to treat your new site as a virtual host. Remember to open up the Windows host file (if that’s your poison) as an administrator or you won’t be able to save the file.
I was torn about what to use for this project but went with NetBeans. It’s OK, if a little slow. Other alternatives I considered were PHPStorm (free for a while) and Visual Studio Code (free forever). Even though you can NetBeans it to build and run any projects, so far I’ve just saved my files and then refreshed my Chrome browser.
I’ve worked with David’s ideas for GET, POST and PUT but made some changes in terms of how the connections are cleaned up/closed and data is presented as JSON. My plan is to start with the API and then build a web front-end to use it on my phone.
Now that I mention displaying JSON, it’s worth talking about a plugin I have tried to show JSON in a nice format. My first choice, based on ratings and downloads, was JSON Formatter 0.60. For some reason, it just wouldn’t play ball in showing the results in a nice form despite working for one of the example sites given. Next up was JSON Viewer 0.18 which is a little beauty and had no problem interpreting my data, so try that if you have any problems.
The Data Model
I’ve stuck with the example tutorial which is namely a book title, author, url and obligatory ID, but have added in ISBN since really, that is my key. I will stick with the ID field only because I know I have more than one of some of my books – better be safe than sorry, right? Author is a tricky one – books don’t always have one author, but this is only an MVP for now and I can live with that. Perhaps I’ll just add a semi-colon separated list if there is more than one?
Let’s finish with some moving images!
Happy New Year everyone!
Written by Stephen Moon
email: stephen at logicalmoon.com