Fix running w/o AP keys setup

This commit is contained in:
Shadowfacts 2022-03-20 14:28:38 -04:00
parent 30e1aa23e7
commit fc7d6d3642
1 changed files with 5 additions and 1 deletions

View File

@ -2,9 +2,13 @@ import express, { Router } from "express";
import { promises as fs } from "fs";
const domain = process.env.DOMAIN;
const pubKeyPemPath = process.env.PUB_KEY_PEM;
export default async function actor(router: Router) {
const pubKeyPem = (await fs.readFile(process.env.PUB_KEY_PEM!)).toString();
if (!pubKeyPemPath) {
return;
}
const pubKeyPem = (await fs.readFile(pubKeyPemPath)).toString();
const actorObj = {
"@context": [
"https://www.w3.org/ns/activitystreams",