View grpc-server-pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>in.bitmaskers</groupId> | |
<artifactId>grpc-server</artifactId> | |
<version>1.0-SNAPSHOT</version> |
View jsonplaceholder-api.raml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%RAML 1.0 | |
title: jsonplaceholder-api | |
/posts: | |
get: | |
responses: | |
200: | |
body: | |
application/json: | |
example: | |
View tailFactorial.dwl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
fun tailFactorial(n:Number, prod:Number = 1) = | |
(if(n == 1 or n == 0) | |
prod | |
else | |
tailFactorial(n-1, (prod * n))) | |
output application/json | |
--- | |
tailFactorial(5) |
View factorial.dwl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
fun factorial(n: Number) = | |
(if(n == 0 or n == 1) | |
1 | |
else | |
n * factorial(n-1)) | |
output application/json | |
--- | |
factorial(10) |
View Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx | |
RUN rm /etc/nginx/conf.d/default.conf | |
COPY nginx.conf /etc/nginx/conf.d/default.conf |
View Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:12 | |
WORKDIR /app | |
COPY package.json . | |
RUN npm install | |
COPY . . | |
CMD node app.js | |
EXPOSE 3500 |
View server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dotenv = require("dotenv"); // Read from .env file | |
const express = require("express"); | |
dotenv.config(); | |
const app = express(); | |
const appid = process.env.PORT; | |
app.get("/", (req, res) => res.send(`Hi from appid: ${appid}`)); | |
app.listen(appid, () => console.log(`Application : ${appid} is listening on port ${appid}`)); |