Git Product home page Git Product logo

be-games-hosting-test's Introduction

NC Games Example API

In order to use this API for your front end project you will need to fork this repo and host following the instructions below.

Hosting a PSQL DB using Heroku

This repo is setup to be hosted on heroku. Follow the steps below to get your own copy of the api up and running.

1. Install the Heroku CLI

Install the heroku cli if you haven't already.

npm i heroku -g

2. Create a Heroku App

Log into Heroku using their command line interface:

heroku login

Clone your fork of this repo and cd into the new directory. From there create an app on heroku using the cli.

heroku create your-app-name

Here your-app-name should be the name you want to give your application. If you don't specify an app name, you'll get a random one which can sometimes be a bit iffy.

This command will both create an app on Heroku for your account. It will also add a new remote to your git repository. Check this by looking at your git remotes:

git remote -v

3. Push Your code up to Heroku

git push heroku main

4. Creating a Hosted Database

Go to the heroku site and log in.

  • Select your application
  • Configure Add-ons
  • Choose Heroku Postgres

The free tier will be adequate for our purposes. This will provide you with a postgreSQL pre-created database!

Check that the database exists. Click settings on it, and view the credentials. Keep an eye on the URI. Don't close this yet!

5. Seeding the Production Database

Check that your database's url is added to the environment variables on Heroku:

heroku config:get DATABASE_URL

If you are in your app's directory, and the database is correctly linked as an add on to Heroku, it should display a DB URI string that is exactly the same as the one in your credentials.

Make sure to run the seed prod script from your package.json:

npm install

npm run seed:prod

6. Review Your App

heroku open

Any issues should be debugged with:

heroku logs --tail

be-games-hosting-test's People

Contributors

mallionaire avatar p-copley avatar douglashellowell avatar augs0 avatar mrmcsnail avatar rosem10 avatar

Watchers

 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.