Lab 5

Run npm run dev in the Next.js folder and, in a second terminal, cd webdev-server && npm run dev (nodemon) so Express LiveDemos reach http://localhost:4000. No remote host is required. The Next.js calculator at the bottom uses same-origin /api/lab5/calculator.

Environment

NEXT_PUBLIC_HTTP_SERVER = http://localhost:4000

Welcome

Working With Objects

Retrieving Objects

Get Assignment

Retrieving Properties

Get Title

Modifying Properties

Update Title

Module (On Your Own)

Get ModuleGet Module Name

Working with Arrays

Retrieving Arrays

Get Todos

Retrieving an Item from an Array by ID

Get Todo by ID

Filtering Array Items

Get Completed Todos

Creating new Items in an Array

Create Todo

Removing from an Array

Remove Todo with ID = 1

Updating an Item in an Array

Update Todo

HTTP Client

Requesting on Click

Response from server:

Requesting on Load

Response from server:


Working with Objects Asynchronously

Assignment

{}

Working with Arrays Asynchronously

Todos


    GET /api/lab5/hello (Next.js Route Handler)

    {}

    Calculator (Next.js Web API)