This feature request is on the difficult side and is considered "extra credit". It is intended for advanced developers to demonstrate how they would tackle a more difficult problem.
Current Functionality
The current app only displays orders when a fetch is specifically called from the application. If someone adds/deletes/edits orders in the database through a method other than the app (such as Postman), the app does not reflect any changes in the order.
Desired functionality
In a real world application, an app like this would likely be deployed in several different locations that share the same database. For example a cashier would enter in an order and then this order would display on a make line for the cooks to make.
An endpoint has been created to simulate this sort of functionality on the server end. Hitting the /live-mode endpoint with a POST request triggers an operation on the server where orders are added and deleted at regular intervals. This interval can be specified by including { time: x } in the request body where x is the number of seconds. If no time is specified, the interval between orders is 5 seconds.
The desired functionality is to have these orders display on the front end as they are being added/deleted on the back end.
This feature request is on the difficult side and is considered "extra credit". It is intended for advanced developers to demonstrate how they would tackle a more difficult problem.
Current Functionality
The current app only displays orders when a fetch is specifically called from the application. If someone adds/deletes/edits orders in the database through a method other than the app (such as Postman), the app does not reflect any changes in the order.
Desired functionality
In a real world application, an app like this would likely be deployed in several different locations that share the same database. For example a cashier would enter in an order and then this order would display on a make line for the cooks to make.
An endpoint has been created to simulate this sort of functionality on the server end. Hitting the
/live-modeendpoint with a POST request triggers an operation on the server where orders are added and deleted at regular intervals. This interval can be specified by including{ time: x }in the request body where x is the number of seconds. If no time is specified, the interval between orders is 5 seconds.The desired functionality is to have these orders display on the front end as they are being added/deleted on the back end.