MCPcopy
hub / github.com/typicode/json-server / prettyPrint

Function prettyPrint

src/cli/run.js:12–36  ·  view source on GitHub ↗
(argv, object, rules)

Source from the content-addressed store, hash-verified

10const jsonServer = require('../server')
11
12function prettyPrint(argv, object, rules) {
13 const root = `http://${argv.host}:${argv.port}`
14
15 console.log()
16 console.log(chalk.bold(' Resources'))
17 for (const prop in object) {
18 // skip printing $schema nodes
19 if (prop === '$schema') continue
20
21 console.log(` ${root}/${prop}`)
22 }
23
24 if (rules) {
25 console.log()
26 console.log(chalk.bold(' Other routes'))
27 for (const rule in rules) {
28 console.log(` ${rule} -> ${rules[rule]}`)
29 }
30 }
31
32 console.log()
33 console.log(chalk.bold(' Home'))
34 console.log(` ${root}`)
35 console.log()
36}
37
38function createApp(db, routes, middlewares, argv) {
39 const app = jsonServer.create()

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…