Posting Messages


Modify your app so that a user can post a message to the bulletin board.

1.  Add an <input> element and a button somewhere in your Main view.  When the user enters text in the <input> element and presses the button, the app sends a fetch request to the POST /message endpoint of API server.  The protocol for the POST /message endpoint is shown below.  Please use v-model where appropriate and handle all error conditions that are possible in your app.

 

2. Deploy your app on localhost and post a message.

3.  Follow the instructions in the tutorial titled Viewing a MongoDB Database With Compass.  The tutorial walks you through installing Compass and verifying that your message was added to the database.

4. If the message was added to the database, deploy your app to Digital Ocean and retest.