Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

migrate odata-mock to typescript #154

Merged
merged 8 commits into from
Mar 14, 2019
Merged
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ kyma-responses
deployments
index.js
**/generated
.nyc_output
.nyc_output
dist
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ci-release: npm-publish docker-push

resolve:
npx lerna bootstrap --hoist
npx lerna run compile

validate:
npx lerna run test
Expand Down
2 changes: 1 addition & 1 deletion examples/combined-odata-mock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var runAsync = async () => {
}

try {
app.use(await odataApp("./varkes_config.json"))
app.use(await odataApp.init("./varkes_config.json"))
app.use(await connectorApp("./varkes_config.json"))
if (port)
app.listen(port, function () {
Expand Down
6 changes: 3 additions & 3 deletions examples/odata-mock/app.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env node
'use strict'

const odataApp = require("@varkes/odata-mock")
const odataMock = require("@varkes/odata-mock")
const app = require('express')()

var runAsync = async () => {
async function runAsync() {
var port
if (process.argv.length > 2 && parseInt(process.argv[2])) {
port = process.argv[2]
}

try {
app.use(await odataApp("./varkes_config.json"))
app.use(await odataMock.init("./varkes_config.json"))
if (port)
app.listen(port, function () {
console.info("Started application on port %d", port)
Expand Down
2 changes: 1 addition & 1 deletion examples/stress-mock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var runAsync = async () => {
fs.writeFileSync("./generated/varkes_config.json", JSON.stringify(config))
try {
app.use(await connectorApp("./generated/varkes_config.json"))
app.use(await odataApp("./generated/varkes_config.json"))
app.use(await odataApp.init("./generated/varkes_config.json"))
app.use(await openapiApp("./generated/varkes_config.json"))
if (port)
app.listen(port, function () {
Expand Down
2 changes: 1 addition & 1 deletion odata-mock/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
*.log
package-lock.json
dist
3 changes: 2 additions & 1 deletion odata-mock/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
Dockerfile
node_modules
Makefile
*.log
*.log
src
14 changes: 11 additions & 3 deletions odata-mock/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
FROM node:11-alpine
FROM node:11-alpine as builder
RUN apk --no-cache upgrade

WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run compile

FROM node:11-alpine

COPY --from=builder /app/dist /app/dist
WORKDIR /app

COPY package*.json ./

ENV NODE_ENV=production
RUN npm install
COPY . .

EXPOSE 10000
CMD ["npm","start"]
1 change: 0 additions & 1 deletion odata-mock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ docker-build:
docker build -t $(APP_NAME):latest .

docker-push:
make docker-build
#DOCKER_TAG comes as parameter from outside -> make docker-push DOCKER_TAG=master
echo $(DOCKERT_TAG)
docker tag $(APP_NAME) $(IMG):$(DOCKER_TAG)
Expand Down
Loading