Previously, I was having issues with getting the Uber authentication processed completed, and getting ride types from Lyft. I am happy to announce that at least one of them is fully working. Sadly, it is not the first one. The solution that I used with getting the latter objective to work still does not seem satisfactory for the first task. Otherwise, I started another sub project with this project, and a technology that I wanted to learn.
Node.js, the Javascript server-side framework solution, or to be exact: Node.js with Express. Funny, to solve a problem is give it an almost identical step: call an REST API endpoint just so it can call another REST API endpoint all in the name to bypass the browser security measures for CORS: REST-ception!
In all seriousness, I was hoping that I did not had to go through this process. It feels like repeating code, but in two different technologies. Granted, there might be different methods to solve this like SSL, so that my application can be a secured application and maybe this could alleviate the CORS problem. Though, there is one solution I may consider for next week.
Instead of having Node.js in a localhost environment; I may send it to an actual server. Heroku, by the company’s definition:
Heroku is a cloud platform that lets companies build, deliver, monitor and scale apps — we're the fastest way to go from idea to URL, bypassing all those infrastructure headaches.
Basically, just send my Node.js server to a ... server. Honestly, I wish there was a better way to handle this, but when I was trying to find a way to get my Uber REST endpoints to work it only accepts HTTPS requests. Understandable, but one has to wonder how you can develop an app using their REST endpoints to even work. Granted, I guess it is convenient their sandbox domain works fine, but the OAuth process had been a real pain in the ass. Maybe i’ll try SSL certificate again with OpenSSL, but that will be next week.
Otherwise, there was progress with the Vue application. I started implementing Vuex stores starting with a separate module for the user. This store will keep their authorization tokens, refresh tokens, expire data, and eventually more of their account information. The user does have a choice if they want to keep this data long term instead of how long they use their app for the current session.
At the moment, I am able to transfer data from a successful authorization from Lyft into the user store. With the data stored, I was able to make some quick changes to how the interface interacts like hiding the Authorize Lyft button, but I may change the styling of that component. Due to the current coding I am unable to show the mix results of both Uber and Lyft together. Maybe next week I can demonstrate that feature.
Another small feature added to the app was toast alerts thanks to Ionic 4. It took me a while to figure out how it all worked since I was unaware it used Promises. Though, I should had figured it was using Promises since I applied the same methods when figuring out modals to show detailed “products”. Any case, these toast messages will show error messages when REST API’s ran into errors during processing. I guess it makes the Uber OAuth situation a good test case to use to get the toast messages working. I just need to figure out to style them with Ionic’s style system.
This has been the week of March 3rd, 2019.