Intergation with an Express js app
caution
#
Warning! ๐ง WIP!In this tutorial, we will learn the Express framework and how to intergate the pesa-js sdk. This Expressjs is built in such a way that it acts as a minimal and flexible Node.js web application framework, providing a robust set of features for building single and multipage, and hybrid web application.
info
This is a very basic example show casing the Customer to Bussiness transaction
In this tutorial, you will learn-
- What is Express.js?
- Installing and using Express, Routes?
- Sample Web server using express.js
- Intergrating Pesa sdk
#
What is Express.js?Express.js is a Node js web application server framework, which is specifically designed for building single-page, multi-page, and hybrid web applications.
It has become the standard server framework for Node.js. Express is the backend part of something known as the MERN stack.
#
Installing and using ExpressWe will be using express-generator
to quickly create an application skeleton. You can run the application generator with the npx command
(available in Node.js 8.2.0 +).
An Express app named myapp
will be created in a folder named myapp/
in the current working directory, no view engine will be set;
Run the app with the following command:
Then, load http://localhost:3000/
in a browser to see the output.
or run curl
#
Intergrating Pesa sdkInstall the package
Add the