https://github.com/shipengine/connect-local-dev-api
API server to support local development of ShipEngine Connect apps
https://github.com/shipengine/connect-local-dev-api
javascript nodejs typescript
Last synced: 3 months ago
JSON representation
API server to support local development of ShipEngine Connect apps
- Host: GitHub
- URL: https://github.com/shipengine/connect-local-dev-api
- Owner: ShipEngine
- Created: 2020-08-07T16:45:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T20:57:50.000Z (over 4 years ago)
- Last Synced: 2025-01-31T11:11:07.882Z (4 months ago)
- Topics: javascript, nodejs, typescript
- Language: TypeScript
- Homepage: https://connect.shipengine.com
- Size: 524 KB
- Stars: 1
- Watchers: 17
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://connect.shipengine.com)
ShipEngine Connect Local Dev API
=======================================[](https://github.com/ShipEngine/connect-local-dev-api/actions)
[](https://github.com/ShipEngine/connect-local-dev-api/actions)[](https://david-dm.org/ShipEngine/connect-local-dev-api)
[](https://www.npmjs.com/package/@shipengine/connect-local-dev-api)
[](LICENSE)
> ### ⚠ WARNING: This is an internal package
> Using this package directly is discouraged and unsupported. Instead, you should install
> [**@shipengine/connect**](https://www.npmjs.com/package/@shipengine/connect) which uses this package under the hood.
> See [our documentation](https://connect.shipengine.com/docs/cli) for more information.
This package makes ShipEngine Connect apps callable via an API. It can be used as a standalone tool, or via the [ShipEngine Connect CLI](https://www.npmjs.com/package/@shipengine/connect-local-dev-api).
Usage
------------------------```sh-session
$ npm install @shipengine/connect-local-dev-api
``````javascript
"use strict";const server = require("@shipengine/connect-local-dev-api")
.default;const pathToApp = process.argv[2];
const port = process.argv[3];server(port, pathToApp);
```Development
---------------------
The development server will start on [localhost:3000](http://localhost:3000) by default. It automatically detects file changes with [nodemon](https://www.npmjs.com/package/nodemon), and transpiles TypeScript on the fly using [ts-node](https://www.npmjs.com/package/ts-node).*Note*: Make sure to edit `nodemon.json` so that the `exec` command points to the absolute path of the Connect App on your system.
```sh-session
$ npm run start:dev
```Testing
---------------------
Test are written in TypeScript, and use [ts-node](https://www.npmjs.com/package/ts-node) to handle transpiling.```sh-session
$ npm test
```Releasing
-----------------------
To release a new version, use the command below.```sh-session
npm run release
```This will do the following:
- Display any outdated dependencies and prompt you to update them
- Run a security vulnerability audit
- Do a clean re-build
- Run all tests
- Run linter checks
- Prompt you for the version number to bump to
- Tag, commit, and push to GitHubOnce the commit is merged to the `master` branch, the [CI/CD script](.github/workflows/CI-CD.yaml) will publish it to NPM.