Skip to content

Commit

Permalink
Merge branch 'vc-issuance-platform' into DIV-8621
Browse files Browse the repository at this point in the history
  • Loading branch information
srprasanna committed Jul 20, 2022
2 parents de351f6 + b754a26 commit 6b7a3a8
Show file tree
Hide file tree
Showing 8 changed files with 734 additions and 5 deletions.
75 changes: 75 additions & 0 deletions backend/vc-certification-service/certification-service-swagger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
openapi: '3.0.0'
info:
version: 1.0.0
title: VC certification
description: verifiable credentials certification service
consumes:
- application/json
produces:
- application/json
paths:
/v1/certify/{entityType}:
post:
tags:
- certification
summary: Certify event of given entityType
operationId: certifyVC
parameters:
- name: entityType
in: path
required: true
type: string
- in: body
name: body
required: true
schema:
type: object
responses:
'200':
description: OK
schema:
$ref: '#/definitions/CertificationSuccess'
'400':
description: Invalid input
schema:
$ref: '#/definitions/Error'
'401':
description: Unauthorized
schema:
$ref: '#/definitions/Error'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Error'
definitions:
CertificationSuccess:
type: object
properties:
message:
type: string
certificateAddResponse:
type: object
properties:
params:
type: object
properties:
msgid:
type: string
status:
type: string
result:
type: object
properties:
osid:
type: string
Error:
type: object
properties:
code:
type: string
message:
type: string
host: divoc.xiv.in
schemes:
- https
basePath: /vc-certification/
10 changes: 10 additions & 0 deletions backend/vc-certification-service/main.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
const express = require('express');
const bodyParser = require('body-parser');
const swaggerUi = require('swagger-ui-express');
const yaml = require('yamljs')

const certifyConfig = require('./src/configs/config');
const {BASE_URL} = require("./src/configs/config");
let certifyRouter = require('./src/routes/certificate.route');

const swaggerDocument = yaml.load('./certification-service-swagger.yml');

const app = express();
const port = certifyConfig.PORT;
app.use(bodyParser.urlencoded({extended: false}));
app.use((bodyParser.json()));

app.use(`${BASE_URL}v1`, certifyRouter);

app.use(
`${BASE_URL}api-docs`,
swaggerUi.serve,
swaggerUi.setup(swaggerDocument)
);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
res.status(404).json({
Expand Down
Loading

0 comments on commit 6b7a3a8

Please sign in to comment.