Giter Site home page Giter Site logo

fedikit / aoba Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 37 KB

๐Ÿƒ Fediverse Integration for Lume & Hono.

Home Page: https://deno.land/x/aoba

License: MIT License

TypeScript 100.00%
activitypub deno fedikit host-meta nodeinfo webfinger fediverse

aoba's Introduction

Aoba

deno.land/x/aoba deno compatibility

๐Ÿƒ Fediverse Integration for Lume & Hono.

Setup

Add Aoba to your deno.json or import_map.json (replace {{version}} with the current version):

{
  "imports": {
    "aoba/": "https://deno.land/x/aoba@v{{version}}/"
  }
}

Set up static nodeinfo for your site.

import nodeinfo from 'aoba/lume/plugins/nodeinfo.ts'
site.use(nodeinfo())

Set up static webfinger for your site.

import webfinger from 'aoba/lume/plugins/webfinger.ts'
site.use(webfinger())

Set up _headers file for your site. (Netlify and Cloudflare Pages)

import headers from 'aoba/lume/plugins/headers.ts'
site.use(headers())

Set up _redirects file for your site. (Netlify and Cloudflare Pages)

import redirects from 'aoba/lume/plugins/redirects.ts'
site.use(redirects())

Hatsu Integration

Hatsu Integration is consistent with the latest version of Hatsu, so it does not follow semver.

For Hatsu users.

Copy the .well-known/* file from the Hatsu instance and set the link alternate for matched page.

import hatsuPlugin from 'aoba/lume/plugins/hatsu.ts'
site.use(
  hatsuPlugin({
    instance: new URL('https://hatsu.local'),
  }),
)

Redirecting .well-known/* and activity+json requests.

import hatsuMiddleware from 'aoba/lume/middlewares/hatsu.ts'
server.use(
  hatsuMiddleware({
    instance: new URL('https://hatsu.local'),
    location: site.options.location,
  }),
)

Redirecting .well-known/* and activity+json requests.

import { hatsuObject, hatsuWellKnown } from 'aoba/hono/middlewares/hatsu.ts'
const instance = new URL('https://hatsu.local')
app.use('/.well-known/*', hatsuWellKnown({ instance }))
app.use('/posts/*', hatsuObject({ instance }))

License

Licensed under MIT.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.