Skip to content

Commit 3014a7a

Browse files
author
meder
committed
Fixing tailor docker creation.
1 parent 41ba623 commit 3014a7a

File tree

7 files changed

+403
-1564
lines changed

7 files changed

+403
-1564
lines changed

05_tailor/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Micro frontends with Tailor
2+
3+
## Setup
4+
To run this example switch into 05_tailor/docker and run ``docker-compose up -d``
5+
Tailor is running on port ``localhost:5000/dashboard``.
6+

05_tailor/server/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ FROM node:14.9.0-alpine
22
WORKDIR /usr/app
33
COPY . .
44
RUN npm install --quiet
5-
ENTRYPOINT node index.js
5+
ENTRYPOINT npm run-script start

05_tailor/server/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const express = require('express')
44
const Tailor = require('node-tailor')
55
const fs = require('fs')
6-
const tailor = new Tailor({templatesPath: __dirname + '/templates'});
6+
const tailor = new Tailor({templatesPath: `${__dirname}/templates/`});
77
const app = express();
88
const productServer = express();
99
const userServer = express();
@@ -33,7 +33,7 @@ productServer.get('/', (request, response) => {
3333
});
3434

3535
const productPort = process.env.PORT || 5001;
36-
productServer.listen(productPort, () => console.log(`Product Fragment Server listening on port ${productPort}...`));
36+
productServer.listen(productPort, () => console.log(`Product fragment server listening on port ${productPort}...`));
3737

3838

3939
//User Fragment Server
@@ -43,7 +43,7 @@ userServer.get('/', (request, response) => {
4343
});
4444

4545
const userPort = process.env.PORT || 5002;
46-
userServer.listen(userPort, () => console.log(`Product Fragment Server listening on port ${userPort}...`));
46+
userServer.listen(userPort, () => console.log(`User fragment server listening on port ${userPort}...`));
4747

4848

4949
//Video Fragment Server
@@ -53,4 +53,4 @@ videoServer.get('/', (request, response) => {
5353
});
5454

5555
const videoPort = process.env.PORT || 5003;
56-
videoServer.listen(videoPort, () => console.log(`Product Fragment Server listening on port ${videoPort}...`));
56+
videoServer.listen(videoPort, () => console.log(`Video fragment server listening on port ${videoPort}...`));

0 commit comments

Comments
 (0)