fork
Configure Feed
Select the types of activity you want to include in your feed.
A decentralized music tracking and discovery platform built on AT Protocol 馃幍
rocksky.app
spotify
atproto
lastfm
musicbrainz
scrobbling
listenbrainz
fork
Configure Feed
Select the types of activity you want to include in your feed.
1import { ctx } from "context";
2import cors from "cors";
3import type { Request, Response } from "express";
4import express from "express";
5import { createProxyMiddleware } from "http-proxy-middleware";
6import { createServer } from "lexicon";
7import API from "./xrpc";
8
9const proxyMiddleware = createProxyMiddleware<Request, Response>({
10 target: "http://localhost:8000",
11 changeOrigin: true,
12});
13
14let server = createServer({
15 validateResponse: false,
16 payload: {
17 jsonLimit: 100 * 1024, // 100kb
18 textLimit: 100 * 1024, // 100kb
19 blobLimit: 5 * 1024 * 1024, // 5mb
20 },
21});
22
23server = API(server, ctx);
24
25const app = express();
26app.use(cors());
27app.use(server.xrpc.router);
28app.use(proxyMiddleware);
29
30app.listen(process.env.ROCKSKY_XPRC_PORT || 3004, () => {
31 console.log(
32 `Rocksky XRPC API is running on port ${process.env.ROCKSKY_XRPC_PORT || 3004}`,
33 );
34});