Test the Application
Before you deploy the application to the remote console, you can test the application on a local server and check if everything works using the Catalyst CLI.
To serve the Catalyst project locally, execute the following command from your project directory:
This Alien City application is now served at default port 3001.
You can now open the application’s localhost URL in a browser to access the Alien City application.
Let’s test the application by entering a city’s name and checking for the history of an alien encounter in the city. Because we have not reported an alien encounter in a city yet, the result should be negative.
Enter a city name in the text box and click Check.
A matching record for this city will not be found in the Data Store, and the application displays a negative response.
Now, let’s report an alien encounter. Click the Report Alien Encounter tab. Enter a city name and click Report. We have entered “Monaco” in our application.
The application will display a pop-up box confirming that the data has been added to the Data Store.
You can verify this by opening your Catalyst console and navigating to Data Store under CloudScale. Click the Data View tab of the table to view the record that was just inserted.
Next, let’s search for this city in the application and check if it fetches this record from the Data Store. Click the Check My City tab in the application and enter the name of the city that you just reported. Here, we enter “Monaco.” Click Check.
The application displays a positive response.
You can also check if the application displays the duplication message by reporting the same city again.
If this setup is working correctly, you can deploy the application.
Last Updated 2024-02-22 23:26:30 +0530 +0530