Giter Site home page Giter Site logo

astroport-classic-api's Introduction

⚠️ Deprecation and maintenace

This repository is no longer actively maintained by Astroport. It will continue to be here on GitHub and freely available for anyone to fork and use, but we will not be actively monitoring or replying to issues and pull requests.

This project was set up with serverless framework.

Setting up development environment

Setup

Install packages

npm install

Copy .env.sample to .env for local development, by default only the GraphQL function is enabled

cp .env.sample .env

Mongodb setup

Restore backup dynamodb dump.

Download Zip file

Unzip and follow the instructions in the readme to restore mongodb. Once you have your database running setup the following environment variables with your table name.

Example for localhost:

MONGODB_URL_RW="mongodb://localhost:27017/astroport"
MONGODB_URL_R="mongodb://localhost:27017/astroport"

Running functions

npm run dev

Running tests

With a local .env

npm run test

Without a local .env

npm run test-dev

Adding constants

All non-secret constants must be defined in src/environment/development.ts and src/environment/production.ts

If something needs to be read from environment variables, add it to .env.dev and .env.prod and use process.env.VAR_NAME in constants to read it in

Adding secrets

Secrets must be defined in GitHub and added to .env.dev and .env.prod at build time using the following

echo -e 'NEW_SECRET="${{ secrets.NEW_SECRET_NAME }}"' >> .env.{dev,prod}

After adding it, they must be defined in src/environment/development.ts and src/environment/production.ts using process.env.VAR_NAME

Running unit tests

  • copy .env.development to .env.local and add MONGODB_URL="...."
  • Mocha config
    • add configuration to mocharc.js, config options available here
    • add global hooks (that run before after all tests) in test/hook.ts

Running unit tests (Webstorm)

  • Mocha config
    • environment variables: DOTENV_CONFIG_PATH=.env.local
    • extra mocha options : --require ts-node/register --require dotenv/config --timeout 60000

astroport-classic-api's People

Contributors

bd21 avatar miclondev avatar donovansolms avatar arthuryeti avatar stefanionescu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.