Skip to content

Commit

Permalink
Express app uses the React frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil committed Mar 10, 2023
1 parent be53557 commit f223aab
Show file tree
Hide file tree
Showing 53 changed files with 833 additions and 855 deletions.
2 changes: 2 additions & 0 deletions expressjs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
public/
1 change: 1 addition & 0 deletions expressjs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
build/
public/
npm-debug.log
6 changes: 5 additions & 1 deletion expressjs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ deps:
build:
npm run build

test:
npm test

clean: frontend.clean
rm -rfv build
rm -rf node_modules

frontend: frontend.build

Expand All @@ -17,5 +21,5 @@ frontend.clean:
frontend.build:
+$(MAKE) -C ../frontend

.PHONY: default deps build clean \
.PHONY: default deps build clean test \
frontend frontend.build frontend.clean
59 changes: 20 additions & 39 deletions expressjs/README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,33 @@
# Knative Showcase for JS

## TODO
This project uses Express.JS framework to showcase the Knative features.

### Required
## Prerequisites

* [x] `/`
This application requires the React frontend application webjar to be built and
deployed to a local maven repository. To do it, run the following command from
the root of the project:

```bash
http :8080
http options :8080
http :8080 user-agent:Mozilla/5.0
```
```shell
make frontend
```

* [x] `/hello`
## Running the application in dev mode

```bash
http :8080/hello
```
You can run your application in dev mode that enables live coding using:

* [x] cloudevents
```shell
npm run dev
```

```bash
http :8080/hello
```
## Packaging and running the application

* [x] `DELAY` parameter (in msec) for `/hello`
* [x] Containerfile to build as Knative app
The application can be packaged as OCI image using:

### Nice to have
```shell
npm run build
```

* [x] readyness and liveness probes
## Learning

```bash
http :8080/health/ready
http :8080/health/live
```

* [x] Prometeus metrics

```bash
http :8080/metrics
```

* [x] OpenAPI & Swagger UI

```bash
http :8080/openapi.json
http :8080/swagger-ui
```
* [x] Input validation (validation by OpenAPI schema)
* [ ] OpenTracing & OpenTelemetry & Distributed Tracing
If you want to learn more about Express.JS, please visit its website: https://expressjs.com/.
Loading

0 comments on commit f223aab

Please sign in to comment.