1.2.0 • Published 3 years ago

djp-api v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

DJP-API

Wrapper API Server menggunakan Fastify.

installing github module as npm module

git clone https://github.com/nasyarobby/djp-api/ djp-api
mkdir new-api-project
cd new-api-project
npm init -y
npm install ../djp-api
code index.js

atau

npm install https://github.com/nasyarobby/djp-api/

cara menggunakan module (index.js)

const DJPApi = require("djp-api");

const app = new DJPApi();
app.start();
const config = {
  port: 3000,
  address: '0.0.0.0',
  service: {
      index(req, res) { 
        res.box('Message', { namaService: 'DJP-API' });
      }
  },
  specificationFilePath: `${__dirname}/swagger.json`,
};

const app = new DJPApi(config);