Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metabase HTTP Util Server #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions util/node-http/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:14

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm install

# Bundle app source
COPY src/ ./src/
COPY public/ ./public/
COPY views/ ./views/

EXPOSE 8080

CMD [ "node", "src/server.js" ]
37 changes: 37 additions & 0 deletions util/node-http/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Metabase Util Server

A generic HTTP and SMTP server that can be used in test pipelines.

## Usage

- Docker build

```shell
docker build -t metabase-qa/metabase-util .
```

- Run and expose HTTP and SMTP ports

```shell
docker run --rm -p 8080:8080 -p 2525:2525 --name metabase-util metabase-qa/metabase-util
```

Specify `-e HTTP_PORT` or `-e SMTP_PORT` to change the port that either server runs on.

## Mail server

By default, an email server with username `admin`/`admin` is running on port `2525`.

When you send an email to the server, it saves the basic fields (subject/from/to/body) to a markdown file.

The file is created using a basic counter that increments each time you send an email, so the first file is named `1.md` and so on.

Browse to http://localhost:8080/emails to see a list of emails that have been received.

Browse to http://localhost:8080/emails/1 (replace `1` with the counter ID) to see a specific email.

## Web server

By default, an express.js web server is running on port `8080`.

It does do much expose some local files at http://localhost:8080/
Loading