@haulmont/jmix-server-mock
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Usage

Command Line

npx @haulmont/jmix-server-mock

By default, it will use schema.graphql and start server at port 4000 http://localhost:4000/graphql

Customize schema path and port using corresponding options

npx @haulmont/jmix-server-mock --schema path/to/schema.graphql --port 8081

From Code

require('@haulmont/jmix-server-mock').createServer(schemaPath)
    .then(({expressApp, apolloServer}) => {
      expressApp.listen({port});
      console.log(`Server ready at http://localhost:${port}${apolloServer.graphqlPath}`);
    })

Usage in Jmix Frontend

Make sure @haulmont/react-scripts is used

  "devDependencies": {
    ...
    "@haulmont/react-scripts": "^4.0.2-alpha.7",
    ...
  }

Specify the following env variable

JMIX_SERVER_MOCK_GRAPHQL=path/to/schema.graphql

The mock server endpoints are available at the same port as dev server (e.g. http://localhost:3000/oauth/token)

proxy configuration won't work once mock server is enabled

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.41latest
3.2.0-next.10next

Version History

VersionDownloads (Last 7 Days)Published
3.2.0-next.10
3.2.0-next.00
3.0.1-next.00
1.0.41
2.0.0-next.60
2.0.0-next.50
2.0.0-next.40
1.0.30
2.0.0-next.30
2.0.0-next.20
2.0.0-next.10
2.0.0-next.00
1.0.2-next.00
1.0.20
1.0.10
1.0.1-next.00
1.0.00
1.0.0-next.210
1.0.0-next.200
1.0.0-next.10
1.0.0-next.00

Package Sidebar

Install

npm i @haulmont/jmix-server-mock

Weekly Downloads

1

Version

1.0.4

License

Apache-2.0

Unpacked Size

26.6 kB

Total Files

17

Last publish

Collaborators

  • cuba-platform