Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Testing commiting and pushing branches
import {
SidetreeIpfsService,
SidetreeResponse,
SidetreeResponseModel
} from '@decentralized-identity/sidetree';
const config: {
/** Port number used by the service. */
port: number;
/** Timeout for fetch request. */
fetchTimeoutInSeconds: number;
} = require('../json/ipfs-config.json');
const requestHandler = new SidetreeIpfsService(config.fetchTimeoutInSeconds);
const app = new Koa();
// Raw body parser.
app.use(async (ctx, next) => {
ctx.body = await getRawBody(ctx.req);
await next();
});
const router = new Router();
router.get('/version', async (ctx, _next) => {
const response = await requestHandler.handleGetVersionRequest();
setKoaResponse(response, ctx.response);
});
router.get('/:hash', async (ctx, _next) => {