Start a local server for directions-api-js-client

I’ve forked the example provided in https://github.com/graphhopper/directions-api-js-client and I try to run it but I can’t (I’m not a JS specialist).

npm install runs fine
npm serve returns this:

node:internal/modules/cjs/loader:988
  throw err;
  ^

Error: Cannot find module 'C:\Users\thomc\workspace\directions-api-js-client\serve'
←[90m    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:833:27)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m    at node:internal/main/run_main_module:22:47←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: []
}

What am I missing ?

You can use only the commands listed in the package.json via npm run xy.
E.g. npm run watch or npm run build

Ok, but as Node is used I suppose that there should be a way to start a web server from this code, right ?

I don’t we have a command for that. But it should work when you directly open index.html with your browser. (just tested it locally)

Powered by Discourse