Get started with Paystack API with nodejs, and expressjs for adding payment features to your application. Before I decided to write this I searched the whole internet to figure out how to use the Paystack API created by kehers because there was none to little documentation on how to use the API instead of using the Paystacks Javascript request format on their official API documentation . Installation After setting up your nodejs application then install the paystack API created by kehers: npm install paystack then after the installation has been completed, we move to set it up. Firstly create a Paystack account and copy the test API secret keys (Note: This is for development purposes only, for production purposes use live keys). Initialization Then go ahead and import Paystack //For JavaScript ES5 const Paystack = require ( "paystack" )( "SECRET_KEY" ); //For JavaScript ES6+ import Paystack from "paystack" ; var paystack = Paystack( "SEC...
Getting Started with KnexJs for SQLs database, firstly install all the important dependencies like express e.t.c for your project. For the installation of knex.js: INSTALLATION $ npm install knex --save Then add one of the following types of SQL you chose to use: $ npm install pg # For PostgreSQL $ npm install pg- native #PostgreSQL with native C++ libpq $ npm install @vscode/sqlite3 # required for sqlite $ npm install better-sqlite3 $ npm install mysql # For MySQL $ npm install mysql2 # For MySQL2 $ npm install oracledb # For oracledb $ npm install tedious Then the next thing you want to do is generate a knexfile in your config folder for configuring your SQL database by using: $ npx knex init This will generate a file called knexfile.js and it contains: knexfile.js // Update with your config settings. /** * @type { Object.<string, import("knex").Knex.Config> } */ module.exports = { development: { client : 'sqlite3' ...