Skip to content
Snippets Groups Projects
Commit 0de18d48 authored by Benguria Elguezabal, Gorka's avatar Benguria Elguezabal, Gorka
Browse files

public release

parents
Branches master
No related tags found
No related merge requests found
node_modules
stages:
- build_and_push
- redeploy
build_and_push:
image: docker/compose:latest
stage: build_and_push
services:
- docker:dind
script:
- docker build -t mock-api-ehic . --tag 094360380/wp4-mock-api-ehic -f Dockerfile
- docker login docker.io -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
- docker push 094360380/wp4-mock-api-ehic
tags:
- docker
only:
- kubernetes
redeploy_at_k8s:
image: alpine/k8s:1.21.5
stage: redeploy
script:
- kubectl config set-cluster local --server="${K8S_SERVER}"
- kubectl config set clusters.local.certificate-authority-data "${K8S_CERTIFICATE_AUTHORITY_DATA}"
- kubectl config set-credentials local --token="${K8S_USER_TOKEN}"
- kubectl config set-context local --cluster=local --user=local
- kubectl config use-context local
- kubectl --insecure-skip-tls-verify version
- kubectl get deployments ujse-mck-ehic -n ujse-dev --insecure-skip-tls-verify
- kubectl rollout restart deployment ujse-mck-ehic -n ujse-dev --insecure-skip-tls-verify
tags:
- docker
only:
- kubernetes
FROM node:16
WORKDIR /app
RUN mkdir -p public/uploads
COPY package.json .
RUN npm install
COPY . .
#Application related arguments
CMD ["npm", "start"]
# INSURANCECARD-mock
https://ujse-mock-api-ehic-ujse-dev.k8s.across-h2020.eu/api-docs/#/
## Description
This is a mocked API for European Health Insurance Card, to start with the first integration of an external API provided by a pilot partner to the ACROSS-Platform.
## Installation for devs and starting the application
1. Just install nodejs and npm
2. npm install
3. npm start
## building and starting the application on docker environment
1. docker build . -t mock-api-insurancecard
2. docker run -p3300:3300 -d mock-api-insurancecard
db.json 0 → 100644
{
"dropdown": [
{
"dropdownID": "applicant",
"data": [
{
"optionID": 0,
"optionVal": [
{
"locale": "en",
"value": "Directly insured"
},
{
"locale": "el",
"value": "Άμεσα ασφαλισμένος"
}
]
},
{
"optionID": 1,
"optionVal": [
{
"locale": "en",
"value": "Indirectly insured"
},
{
"locale": "el",
"value": "Έμμεσα ασφαλισμένος"
}
]
}
]
},
{
"dropdownID": "purpose",
"data": [
{
"optionID": 0,
"optionVal": [
{
"locale": "en",
"value": "New Card"
},
{
"locale": "el",
"value": "Νέα Κάρτα"
}
]
},
{
"optionID": 1,
"optionVal": [
{
"locale": "en",
"value": "Card Expiration"
},
{
"locale": "el",
"value": "Λήξη Κάρτας"
}
]
},
{
"optionID": 2,
"optionVal": [
{
"locale": "en",
"value": "Card Loss"
},
{
"locale": "el",
"value": "Απώλεια Κάρτας"
}
]
}
]
}
],
"my-application": [
{
"amka": "30128501444",
"afm": "123456789",
"dateofbirth": "2023-04-30",
"firstname": "Ιωάννης",
"lastname": "Ιωάννου",
"fathersname": "Paul",
"mothersname": "Elisabeth",
"email": "jb@gmail.com",
"mobile": "00306912345678",
"applicant": "0",
"applicant-amka": "string",
"applicant-afm": "string",
"applicant-dateofbirth": "2023-04-30",
"purpose": "1",
"firstnameLatinChar": "Ioannis",
"lastnameLatinChar": "Ioannou",
"startDate": "2023-04-30",
"street": "Kifisias",
"street-num": "100",
"zipCode": "11122",
"city": "Athens",
"id": 1
},
{
"amka": "30128501444",
"afm": "123456789",
"dateofbirth": "2023-04-30",
"firstname": "Ιωάννης",
"lastname": "Ιωάννου",
"fathersname": "Paul",
"mothersname": "Elisabeth",
"email": "jb@gmail.com",
"mobile": "00306912345678",
"applicant": "0",
"applicant-amka": "string",
"applicant-afm": "string",
"applicant-dateofbirth": "2023-04-30",
"purpose": "1",
"firstnameLatinChar": "Ioannis",
"lastnameLatinChar": "Ioannou",
"startDate": "2023-04-30",
"street": "Kifisias",
"street-num": "100",
"zipCode": "11122",
"city": "Athens",
"id": 2
}
]
}
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
{
"name": "insurancecard-mock-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"js-yaml": "^4.1.0",
"json-server": "^0.17.0",
"multer": "^1.4.5-lts.1",
"server": "^1.0.38",
"swagger-ui": "^4.10.3",
"swagger-ui-dist": "^4.10.3",
"swagger-ui-express": "^4.6.2"
}
}
{
"/dropdown": "/dropdown"
}
openapi: 3.0.3
info:
title: European Health Insurance Card Mock-API
description: An API-Spec used for European Health Insurance Card.
version: 0.1.0
servers:
- url: https://ujse-mock-api-ehic-ujse-dev.k8s.across-h2020.eu/
#- url: http://localhost:3333/
paths:
/my-application:
post:
summary: Issue European Health Insurance Card.
description: Issue a European Health Insurance Card instantly.
requestBody:
content:
application/json:
schema:
$ref: '#/components/requestBodies/My-application'
responses:
'201': # status code
description: OK - Created
content:
application/json:
schema:
$ref: '#/components/schemas/My-application'
/dropdown:
get:
summary: Retrieve dropdown options.
description: Retrieve dropdown options for status of applicant and issuing purpose.
responses:
'200': # status code
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Dropdown'
components:
schemas:
Dropdown:
type: array
items:
type: object
properties:
dropdownID:
type: string
data:
type: array
items:
type: object
properties:
optionID:
type: integer
optionVal:
type: array
items:
type: object
properties:
locale:
type: string
value:
type: string
My-application:
type: array
items:
type: object
properties:
outputId:
type: integer
title:
type: string
type:
type: string
language:
type: string
description:
type: string
contentType:
type: string
content:
type: string
requestBodies:
My-application:
type: object
properties:
amka:
type: string
required: true
example: "30128501444"
afm:
type: string
required: true
example: "123456789"
dateofbirth:
type: string
format: date
pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
required: true
firstname:
type: string
required: true
example: "Ιωάννης"
lastname:
type: string
required: true
example: "Ιωάννου"
fathersname:
type: string
required: true
example: "Paul"
mothersname:
type: string
required: true
example: "Elisabeth"
email:
type: string
example: "jb@gmail.com"
mobile:
type: string
required: true
example: "00306912345678"
applicant:
type: string
required: true
example: "0"
applicant-amka:
type: string
applicant-afm:
type: string
applicant-dateofbirth:
type: string
format: date
pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
purpose:
type: string
required: true
example: "1"
firstnameLatinChar:
type: string
required: true
example: "Ioannis"
lastnameLatinChar:
type: string
required: true
example: "Ioannou"
startDate:
type: string
format: date
pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
required: true
street:
type: string
required: true
example: "Kifisias 10"
zipCode:
type: string
required: true
example: "11122"
city:
type: string
required: true
example: "Athens"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment