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

@astrojs/deno

Package Overview
Dependencies
Maintainers
4
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrojs/deno

Deploy your site to a Deno server

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
336
decreased by-14.72%
Maintainers
4
Weekly downloads
 
Created
Source

@astrojs/deno

A server-side rendering adapter for use with Deno targets. Write your code in Astro/Node and deploy to Deno servers.

In your astro.config.mjs use:

import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';

export default defineConfig({
  adapter: deno()
});

After performing a build there will be a dist/server/entry.mjs module. You can start a server simply by importing this module:

import './dist/entry.mjs';

API

Adapter options

This adapter automatically starts a server when it is imported. You can configure this through options:

import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';

export default defineConfig({
  adapter: deno({
    start: false
  })
});

If disabling start you need to write your own web server and use handle to render requests:

import { serve } from "https://deno.land/std@0.132.0/http/server.ts";
import { handle } from './dist/entry.mjs';

serve((req: Request) => {
  // Check the request, maybe do static file handling here.

  return handle(req);
});

You an also pass in a port/hostname to use:

import { defineConfig } from 'astro/config';
import deno from '@astrojs/deno';

export default defineConfig({
  adapter: deno({
    port: 8081,
    hostname: 'myhost'
  })
});

FAQs

Package last updated on 21 Apr 2022

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