Skip to main content

Initialize Express Server

Install necessary Dependencies to work SDK, which requires body-parser,express

index.js
const express = require("express");
const bodyParser = require("body-parser");
const { PaytmConfig } = require("@enjoys/paytm");
const app = express();
const path = require("path");
app.use(bodyParser.json()); // necessary without this credentials are undefined
app.use(express.json()); // necessary
app.use(bodyParser.urlencoded({ extended: true }));

const paytm = require("./instance/paytm");

app.listen(8080, () => console.log("http://localhost:8080"));