Welcome to the Linux Foundation Forum!

Mocking GET Routes (7)

'use strict'

module.exports = async function (fastify, opts) {
  fastify.get('/', async function (request, reply) {
    return {DATA HERE};{
  })
}

Where {DATA HERE} is whatever mock data we wish to send as a response for that route.

What are we supposed to replace the DATA HERE with in order to get the code running? Thanks.

Comments

  • aeromike
    aeromike Posts: 2

    I figured that out by myself. Basically, copy the same code structure as the other index.js files (electronics and confectionery) with whatever data you want. It will get the code running.

Categories

Upcoming Training