Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@julikhris/astro-fastify

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@julikhris/astro-fastify

ssr fastify

  • 0.0.34
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Fastify SSR

Fastify Server Side Rendering provider for the AstroBuild Framework. This is being built out as a plugin to be used as part of the JuliKhris lowcode framework which is being build on top of AstroBuild. To leverage Data Islands, Minimal JS and Server Side Rendering.

Although you can use as adapter for AstroBuild. Currently being used for clients on Azure Windows, Azure Linux, Oracle Cloud, and AWS

Coming Soon:

  1. Extraction of viteFastifySSRPlugin into its own repo\vite plugin currently resides in index.ts
  2. Test scripts

Special thanks to @matthewp/astro-fastify; this is an extension of that adapter writing in TS with additional parameters for customization.

Authors

  • @DinoDon

Installation

Install @julikhris/astro-fastify

npm install @julikhris/astro-fastify

Usage/

//Import the adapter 
// Git Repo Comin Soon!
import adapter from "@julikhris/astro-fastify";

//create a arrow function to build adapter values
// Parameters to pass:
//client relative: variable for relative path to client files example dist\client
// static routes build a colleciton of statice routes css folder etc
// example const 
// getStaticRoutes = (clientRoot) => {
//   console.log("getting static routes")
//  return [
//    {
//      clientRelative:clientRoot,
//      root: "assets",
//      prefix: "/assets/",
//      setHeaders(res) {
//        res.setHeader("Cache-Control", "max-age=31536000,//immutable");
//      },
//      decorateReply: true,
//    }
//  ]
//  }
// server routes to run in dev only
// server routes to run in prod
// port to listen on Azure windows will default to path as it used named pipes
// plugin hooks that attaches to Fastify onrequest hook: for example inject auth hander

const useFastifyAdapter = (
  clientRelative,
  staticRoutes,
  devRoutesApi,
  productionRoutesApi,
  port,
  pluginHooksApi
) => {
  return adapter({
    clientRelative,
    staticRoutes,
    devRoutesApi,
    productionRoutesApi,
    port,
    pluginHooksApi,
  });
};

// add adapter to astro.config
 adapter: useFastifyAdapter(
    clientRelative,
    getStaticRoutes(clientRelative),
    await getServerRoutes(),
    pathToFileURL(resolvedServerRoutesPath),
    serverPort,
    pathToFileURL(resolvedServerHooksPath)
  ),

Documentation

Coming Soon

Support

Coming Soon

Contributing

Contributions are always welcome!

Coming Soon

FAQs

Package last updated on 20 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc