0.10.4 • Published 1 month ago

@procore-oss/backstage-plugin-announcements-backend v0.10.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

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

# start the backend
yarn start

Database

The plugin includes a better-sqlite3 database seeded with categories and announcements.

With the backend running,

# runs migrations and seeds the database
yarn db:setup

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

Other commands

# run migrations
yarn db:migrations

# seed the database
yarn db:seed

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;