From da51bd777c2a02e008267add4a3f27b1668a27f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 23 Apr 2020 09:26:30 +0200 Subject: [PATCH] Add README and comment to clarify example status of backend --- packages/backend/README.md | 20 ++++++++++++++++++++ packages/backend/src/index.ts | 10 +++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 packages/backend/README.md diff --git a/packages/backend/README.md b/packages/backend/README.md new file mode 100644 index 0000000000..1246be60bc --- /dev/null +++ b/packages/backend/README.md @@ -0,0 +1,20 @@ +# example-backend + +This package is an EXAMPLE of a Backstage backend. + +The main purpose of this package is to provide a test bed for Backstage plugins +that have a backend part. Feel free to experiment locally or within your fork +by adding dependencies and routes to this backend, to try things out. + +Our goal is to eventually amend the create-app flow of the CLI, such that a +production ready version of a backend skeleton is made alongside the frontend +app. Until then, feel free to experiment here! + +## Development + +To run the backend in watch mode, use `yarn start`. + +## Documentation + +- [Backstage Readme](https://github.com/spotify/backstage/blob/master/README.md) +- [Backstage Documentation](https://github.com/spotify/backstage/blob/master/docs/README.md) diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 17c606c037..307bd04be7 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -14,12 +14,20 @@ * limitations under the License. */ +/* + * Hi! + * + * Note that this is an EXAMPLE Backstage backend. Please check the README. + * + * Happy hacking! + */ + import express from 'express'; import cors from 'cors'; import helmet from 'helmet'; import { testRouter } from './test'; -const PORT = 7000; +const PORT = parseInt(process.env.PORT ?? '', 10) || 7000; const app = express(); app.use(helmet());