Backend for announcements.
- Duplicate the
.envtemplate
file and rename it to.env
. SetNODE_ENV
todev
, then setDEV_URI
tomongodb://localhost:27017/announcements-dev
. Fill out the other environment variables.
- For AppDev members, the development
.env
file is pinned in the#pod-announcements
channel. - Note that in order to run the database locally, you will need to have MongoDB installed.
- Run
yarn
to install dependencies. - Start the development server by running
yarn dev
. To run the production build instead, useyarn build
followed byyarn start
.
- Make sure dependencies are installed with
yarn
. - To run the test suite, use
yarn test
.
- To generate an auth token, navigate to the OAuth 2.0 Playground.
- Go to settings in the top right, select Use your own OAuth credentials and pass in the Client ID and secret. These are pinned in the
#announcements-dev
channel. - For the scope, select Google OAuth2 API v2, check all 3 options, then click on Authorize APIs.
- If prompted to log in, choose an account that you want to authenticate.
- Click Exchange authorization code for tokens.
- In the response body, copy the
id_token
field and use that as a Bearer token.
- If using VSCode, install the Prettier extension and configure your settings to use it.