🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@genesisx/mock-api-server

Package Overview
Dependencies
Maintainers
14
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@genesisx/mock-api-server

Generator package for creating mock-api-server for using mock apis.

latest
npmnpm
Version
4.0.1-beta0.2
Version published
Maintainers
14
Created
Source

mock-api-server

This is a generator for generating mock server apps created by the Genesis project

Usage

How to use

To install the package in your nx workspace run one of the below command

  • npm i @genesisx/mock-api-server
  • or
  • yarn add @genesisx/mock-api-server

Creating gql mock type server

Select Generator tool from the NX console as shown in the image in your visual studio Navigate to NX console > Generate > @genesisx/mock-api-server

And fill in the form as follows;

- appName
 Mock Api Server Name that will be under apps folder of your project

-portNumber
Port Number to be changed in file called .env

Serve your mock service created through NX console > Serve > <your_project_name>

via command line

Run the below command from command line (root folder) if nx console doesnt work nx generate @genesisx/mock-api-server:templates <mockServerName> <portNumber> --no-interactive

Contribution

Running build and lints

Run nx lint mock-api-server to execute the lint checks on this package.

Run nx build mock-api-server to build this package.

Run nx test mock-api-server to execute the unit tests via Jest.

Publish to NPM

To publish the package you must first be logged into NPM (npm login) then run this command from the root of the project.

  • Make sure the package name in package.json should start with @genesisx/
  • Also use the correct version number in package.json same will be used for the published package.
  • Use your NPM js credentials (Publicis Sapient) with publish rights
  • Verify the package at https://www.npmjs.com/settings/genesisx/packages
npm publish dist/packages/mock-api-server --access public

Local development and testing

If you're going to locally developm and run/test this package you need to build it and copy into node_modules with every change. You can simply do this by running a bash command below:

yarn nx run mock-api-server:build && cp -R dist/packages/mock-api-server/ <new-wsp>/node_modules/@genesisx

FAQs

Package last updated on 15 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts