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

public release

parents
Branches
Tags
No related merge requests found
node_modules
index.js.bak
\ No newline at end of file
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-birth-certificate . --tag 094360380/wp4-mock-api-birth-certificate
- docker login docker.io -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
- docker push 094360380/wp4-mock-api-birth-certificate
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-birth-cert -n ujse-dev --insecure-skip-tls-verify
- kubectl rollout restart deployment ujse-mck-birth-cert -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"]
# BIRTHCERTIFICATE-mock
https://ujse-mock-api-birth-cert-ujse-dev.k8s.across-h2020.eu/api-docs/#/
## Description
This is a mocked API for Birth Certificate, 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. Install nodejs and npm
2. npm install
3. npm start
## building and starting the application on docker environment
1. docker build . -t mock-api-birthcertificate
2. docker run -p3333:3333 -d mock-api-birthcertificate
db.json 0 → 100644
{
"children": [
{
"dropdownID": "person",
"data": [
{
"optionID": 0,
"optionVal": [
{
"locale": "en",
"value": "For myself"
},
{
"locale": "el",
"value": "Για εμένα"
}
]
},
{
"optionID": 1,
"optionVal": [
{
"locale": "en",
"value": "Child 1: Georgios"
},
{
"locale": "el",
"value": "Τέκνο 1: Γεώργιος"
}
]
},
{
"optionID": 2,
"optionVal": [
{
"locale": "en",
"value": "Child 2: Maria"
},
{
"locale": "el",
"value": "Τέκνο 2: Μαρία"
}
]
}
]
}
],
"my-application": [
{
"afm": "123456789",
"dateofbirth": "2023-04-30",
"firstname": "Michael",
"lastname": "George",
"fathersname": "Jordan",
"mothersname": "Mary",
"person": "0",
"email": "mg@gmail.com",
"id": 1
},
{
"afm": "223456789",
"dateofbirth": "2023-04-30",
"firstname": "Michael",
"lastname": "George",
"fathersname": "Jordan",
"mothersname": "Mary",
"person": "0",
"email": "mg@gmail.com",
"id": 2
},
{
"afm": "323456789",
"dateofbirth": "2023-04-30",
"firstname": "Michael",
"lastname": "George",
"fathersname": "Jordan",
"mothersname": "Mary",
"person": "0",
"email": "mg@gmail.com",
"id": 3
},
{
"afm": "123456789",
"dateofbirth": "2023-04-30",
"firstname": "Michael",
"lastname": "George",
"fathersname": "Jordan",
"mothersname": "Mary",
"person": "0",
"email": "mg@gmail.com",
"id": 4
},
{
"afm": "523456789",
"dateofbirth": "2023-04-30",
"firstname": "Michael",
"lastname": "George",
"fathersname": "Jordan",
"mothersname": "Mary",
"person": "0",
"email": "mg@gmail.com",
"id": 5
}
]
}
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
{
"name": "birthcertificate-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",
"swagger-ui": "^4.10.3",
"swagger-ui-dist": "^4.10.3",
"swagger-ui-express": "^4.3.0"
}
}
{
"/children": "/children"
}
openapi: 3.0.3
info:
title: Birth Certificate Mock-API
description: An API-Spec used for birth certificate.
version: 0.1.0
servers:
- url: https://ujse-mock-api-birth-cert-ujse-dev.k8s.across-h2020.eu
#- url: http://localhost:8888/
paths:
/my-application:
post:
summary: Issue birth certificate.
description: Issue birth certificate for you or your minor children.
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'
/children:
get:
summary: Retrieve list of self and children.
description: Retrieve list of self and children.
responses:
'200': # status code
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Children'
components:
schemas:
Children:
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:
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: "Michael"
lastname:
type: string
required: true
example: "George"
fathersname:
type: string
required: true
example: "Jordan"
mothersname:
type: string
required: true
example: "Mary"
person:
type: string
required: true
example: "0"
email:
type: string
example: "mg@gmail.com"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment