Skip to content

Instantly share code, notes, and snippets.

@schadokar
Created April 13, 2019 15:18
Show Gist options
  • Save schadokar/f560e7d20bdbfb225277124ce8508f25 to your computer and use it in GitHub Desktop.
Save schadokar/f560e7d20bdbfb225277124ce8508f25 to your computer and use it in GitHub Desktop.
docker-ethereum call the logic.js
const express = require("express");
const router = express.Router();
const logic = require("../../ethereum/logic");
router.get("/", async (req,res,next) => {
let message = await logic.getMessage();
res.send(message);
})
router.post("/", async (req,res, next) => {
let message = await logic.setMessage(req.body.message);
res.send(message.transactionHash);
})
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment