Giter Club home page Giter Club logo

api-backend's Introduction

Webaverse API backend

Node server hosted on AWS, mainly used for REST endpoints.

Dev Setup

  1. npm install

  2. Create a config.json and paste this in:

{
    "accessKeyId": "<ACCESS_KEY_ID>",
    "secretAccessKey": "<SECRET_ACCESS_KEY>"
}

You can get these credentials from Avaer.

  1. Create a cert/ folder. Create 2 new files inside: fullchain.pem and privkey.pem. Ask Avaer for the certificates.

  2. npm run start (forever) or npm run dev (nodemon).

API Docs

worlds.exokit.org

GET worlds.exokit.org/{worldId}

Returns an object with: Host, World Name and Uptime of server.

POST worlds.exokit.org/create

Returns an object with: Host, World Name and Uptime of server.

DELETE worlds.exokit.org/{worldId}

Terminates the ec2 associated with world.

How to deploy new world-server code.

1.) Make sure your dialog repo changes are commited to the dialog/worlds branch.

2.) Go to world-server repo and bump the package.json version number. (this triggers the GH action to execute and create a new release, it will pull dialog/worlds)

3.) After the GH action is done, copy the hash of the release and paste it into exokit-backend/routes/worlds.js in the updateZipFile() fetch url.

4.) SSH into exokit-backend EC2 server (can get the IP from AWS dashboard), and delete the world-server.zip file. (it exists inside ~/exokit-backend/)

5.) npm run start inside of exokit-backend. (this will start a forever process and start downloading the new ZIP file from the Github release.

6.) After it is done, verify the logs. (sudo forever list, sudo forever logs [index]) The server is up and running and will create new world-servers with the fresh codebase.

P.S. To truly wipe the old servers and start fresh, you need to login to AWS and terminate the old world servers OR you can use the DELETE API for worlds.

api-backend's People

Contributors

avaer avatar charisra avatar chrislatorres avatar exokitbot avatar lalalune 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.