GithubHelp home page GithubHelp logo

kwitter-api's Introduction

Kwitter API

Basic setup for local development

  • fork this repo
  • git clone to your local computer then cd kwitter-api
  • setup your database:
    • createdb kwitter (you must have postgresql installed to have this command)
  • create your .env file:
    • cp .env.example .env
  • edit the .env file to look like:
DATABASE_URL="postgres://127.0.0.1/kwitter"
JWT_SECRET="whateveryouwant"
  • From the command line, type npm install

  • From the command line, type node index.js or nodemon index.js

    confirm that the api is working locally by making a request to GET localhost:3000/messages

    note: visiting localhost:3000 will take you to a swagger/openapi documentation page for the available api endpoints. There is also a postman collection file available to use: Kwitter API.postman_collection.json

Basic setup for deploying to heroku

  • Create your heorku app from the commandline: heroku create your-api-name
  • Setup a postgres database addon for your heroku app: heroku addons:create heroku-postgresql
  • Confirm that a DATABASE_URL variable was added to your heroku app: heroku config
  • Setup your config variable for the JWT_SECRET for your heroku app: heroku config:set JWT_SECRET=whateveryouwant
  • Push code to your heroku app: git push heroku master
  • Run heroku logs --tail to watch logs in real-time to confirm that the status of the app has started up successfully
  • Open your app with heroku open -- this should automatically take you to the openapi documentation page which lists all the server endpoints.
  • For more help, refer to this guide https://devcenter.heroku.com/articles/getting-started-with-nodejs as well as other Heroku docs for more information on adjusting config vars and adding a postgres db on Heroku

kwitter-api's People

Contributors

thurt avatar aphonicchaos avatar swkane avatar nate998877 avatar

Watchers

James Cloos 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.