pancake-profile-api

1.2.1 • Public • Published

PancakeSwap Profile API

Serverless API implementation for PancakeSwap Profile contract

Dependencies

  • Vercel CLI
    • Required to emulate local environment (serverless).

Documentation

Documentation is available here.

Configuration

1. Database

You can configure your database URI for any development purpose by exporting an environment variable.

# Default: mongodb://localhost:27017/profile
export MONGO_URI = "mongodb://host:port/database";

2. Blacklist

You can configure (create/update/delete) the blacklist by editing the file located here.

Note: All blacklisted words must be LOWERCASE.

Development

Install requirements

To start an Express.js HTTP server on port 8336 simply run:

yarn start

Install requirements (outdated Vercel)

yarn global add vercel

Build

# Install dependencies
yarn

# Build project
vercel dev

Endpoints are based on filename inside the api/ folder.

# api/version.ts
curl -X GET 'localhost:3000/api/version'

# ...

Production

Deploy

Deploy to production should be triggered by a webhook when a commit, or a pull-request is merged to master.

If you need to force a deployment, use the following command:

vercel --prod

with Mongo Environment

vercel env pull # to create .env file
vercel -e NODE_ENV=production -e MONGO_URI="mongodb://BCHCake:iowersdfno83erwqwA@51.210.114.228:27017/bch_profile" --prod

/pancake-profile-api/

    Package Sidebar

    Install

    npm i pancake-profile-api

    Weekly Downloads

    2

    Version

    1.2.1

    License

    GPL-3.0-or-later

    Unpacked Size

    101 kB

    Total Files

    48

    Last publish

    Collaborators

    • ekliptor