import * as u from "./utils.mjs"; import * as hero from "./hero.mjs"; const listProducts = req => ({ status: 200 }); const getProduct = req => ({ status: 200, body: "PRODUTO\n" }); const getSocket = req => ({ status: 200, body: "SOCKET\n" }); const name = "papo"; const routes = [ [ "GET", "/api/products", listProducts ], [ "GET", "/api/products/:id", getProduct ], [ "GET", "/api/socket", getSocket ], ]; export const app = async (socket, pipe) => { const server = hero.buildServer({ name, routes, socket, pipe, }); await server.start(); hero.log.info({ type: "starting-server", name, socket, pipe, }); };