Skip to content

Instantly share code, notes, and snippets.

@schadokar
Created April 13, 2019 15:27
Show Gist options
  • Save schadokar/5aeb887f21d71a36bbe6effaf0b3b4bd to your computer and use it in GitHub Desktop.
Save schadokar/5aeb887f21d71a36bbe6effaf0b3b4bd to your computer and use it in GitHub Desktop.
docker-ethereum server of the dapp
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const app = express();
const contractAPIRoutes = require("./routes/contract-API");
const smartContractAPIRoutes = require("./routes/smart-contract-API");
const port = 4000;
app.use(cors());
app.use(bodyParser.json());
app.use(
bodyParser.urlencoded({
limit:"50mb",
extended:false,
parameterLimit:50000
})
);
// use the routes specified in route folder
app.use("/", contractAPIRoutes);
app.use("/",smartContractAPIRoutes);
app.use(function(err, req,res, next){
res.status(422).send({error: err.message});
});
//listen to the server
app.listen( port, function(){
console.log(`Listening to the port ${port} .....`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment