Skip to content

Commit

Permalink
refactor: rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Apr 20, 2020
1 parent cb8898b commit e5b910b
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# @commercetools-backend/server-express
# @commercetools-backend/express

<p align="center">
<a href="https://www.npmjs.com/package/@commercetools-backend/server-express"><img src="https://badgen.net/npm/v/@commercetools-backend/server-express" alt="Latest release (latest dist-tag)" /></a> <a href="https://www.npmjs.com/package/@commercetools-backend/server-express"><img src="https://badgen.net/npm/v/@commercetools-backend/server-express/next" alt="Latest release (next dist-tag)" /></a> <a href="https://bundlephobia.com/result?p=@commercetools-backend/server-express"><img src="https://badgen.net/bundlephobia/minzip/@commercetools-backend/server-express" alt="Minified + GZipped size" /></a> <a href="https://github.com/commercetools/merchant-center-application-kit/blob/master/LICENSE"><img src="https://badgen.net/github/license/commercetools/merchant-center-application-kit" alt="GitHub license" /></a>
<a href="https://www.npmjs.com/package/@commercetools-backend/express"><img src="https://badgen.net/npm/v/@commercetools-backend/express" alt="Latest release (latest dist-tag)" /></a> <a href="https://www.npmjs.com/package/@commercetools-backend/express"><img src="https://badgen.net/npm/v/@commercetools-backend/express/next" alt="Latest release (next dist-tag)" /></a> <a href="https://bundlephobia.com/result?p=@commercetools-backend/express"><img src="https://badgen.net/bundlephobia/minzip/@commercetools-backend/express" alt="Minified + GZipped size" /></a> <a href="https://github.com/commercetools/merchant-center-application-kit/blob/master/LICENSE"><img src="https://badgen.net/github/license/commercetools/merchant-center-application-kit" alt="GitHub license" /></a>
</p>

Zero-config HTTP server as Express.js for working with Merchant Center Custom Applications
Zero-config HTTP server as Express.js to facilitate development.

This package is primarily built for HTTP servers used by Custom Applications and it provides a set of components to facilitate the development of the HTTP server.

## Install

```bash
$ npm install --save @commercetools-backend/server-express
$ npm install --save @commercetools-backend/express
```

## Session middleware

This middleware should be used to handle the authentication exchange between the server and the `/proxy/forward-to` endpoint of the Merchant Center API.
This middleware should be used to handle the authentication exchange between the server and the `/proxy/forward-to` endpoint of the Merchant Center API Gateway.

> You can read more about the "Proxy to External API" concepts [here](https://docs.commercetools.com/custom-applications/main-concepts/proxy-to-external-api).
```js
const {
createSessionMiddleware,
CLOUD_IDENTIFIERS,
} = require('@commercetools-backend/server-express');
} = require('@commercetools-backend/express');

app.use(createSessionMiddleware({ mcApiUrl: CLOUD_IDENTIFIERS.GCP_EU }));
app.use((request, response, next) => {
Expand All @@ -42,4 +42,4 @@ app.use((request, response, next) => {
- `aws-fra`: `https://mc-api.eu-central-1.aws.commercetools.com`
- `aws-ohio`: `https://mc-api.us-east-2.aws.commercetools.com`

- `inferIssuer` (_boolean_): determines whether the issuer should be inferred from the custom request HTTP header `x-mc-api-cloud-identifier` which is sent by the MC API when forwarding the request. This might be useful in case the server is used in multiple regions.
- `inferIssuer` (_boolean_): determines whether the issuer should be inferred from the custom request HTTP header `x-mc-api-cloud-identifier` which is sent by the Merchant Center API Gateway when forwarding the request. This might be useful in case the server is used in multiple regions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@commercetools-backend/server-express",
"name": "@commercetools-backend/express",
"version": "16.5.3",
"description": "Zero-config HTTP server as Express.js for working with Merchant Center Custom Applications",
"description": "Zero-config HTTP server as Express.js to facilitate development",
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
"repository": {
"type": "git",
"url": "https://github.com/commercetools/merchant-center-application-kit.git",
"directory": "packages-backend/server-express"
"directory": "packages-backend/express"
},
"homepage": "https://docs.commercetools.com/custom-applications",
"keywords": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages-backend/express/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../tsconfig.json",
}
File renamed without changes.

0 comments on commit e5b910b

Please sign in to comment.