@procore-oss/backstage-plugin-announcements-backend
TypeScript icon, indicating that this package has built-in type declarations

0.10.6 • Public • Published

backstage-plugin-announcements-backend

This is the backend for the Announcements plugin. This plugin provides:

Installation

Are you looking to install the announcements plugin? See the project's installation guide.

Local development

Setup

# install dependencies
yarn install

# set .env
cp env.sample .env
source .env

# start the backend
yarn start

Database

The plugin includes support for postgres and better-sqlite3 databases. By default, the plugin uses a postgres database via docker-compose. Update the app-config.yaml to use the better-sqlite3 database.

Postgres

The postgres database can be started with docker-compose. Don't forget to copy the env.sample.

# start the postgres database
docker-compose up -d

# stop the postgres database
docker-compose down -v

better-sqlite3

The better-sqlite3 database can be seeded with categories and announcements.

With the backend running,

# runs migrations and seeds the database
yarn db:setup

# or run them separately
yarn db:migrations
yarn db:seed

This will create a local.sqlite file under the db/ directory.

Visit knexjs to learn more about the database migrations and seeding.

API Examples

# get all announcements
curl http://localhost:7007/api/announcements/announcements

# get all categories
curl http://localhost:7007/api/categories
// get all announcements
const response = await fetch(
  'http://localhost:7007/api/announcements/announcements',
);
const data = await response.json();
return data;

Readme

Keywords

none

Package Sidebar

Install

npm i @procore-oss/backstage-plugin-announcements-backend

Weekly Downloads

8,535

Version

0.10.6

License

MIT

Unpacked Size

71.4 kB

Total Files

24

Last publish

Collaborators

  • jmeridth
  • procore-oss-user