Redpoint

Redpoint

Configuration

Directories

Build - (dirs.build)

  • Type: string
  • Default: ./dist

The directory where redpoint build will compile your final build to.

{
    "dirs": {
        "build": "./out"
    }
}

Pages - (dirs.pages)

  • Type: string
  • Default: ./src/pages
{
    "dirs": {
        "pages": "./src/content"
    }
}

Public - (dirs.public)

  • Type: string
  • Default: ./public

The directory for your static assets. These files are served at the root URL(/) during development and copied directly to your build directory. They're always handled as-is, without any processing or bundling.

{
    "dirs": {
        "public": "./src/public"
    }
}

Server

Port - (server.port)

  • Type: number
  • Default: 7894

Change the port to run the website on.

Example: 4321

{
    "server": {
        "port": 4321
    }
}

Hostname - (server.hostname)

  • Type: string
  • Default 0.0.0.0 (localhost)

Change the hostname to run the website on.

Example: 192.168.0.13

{
    "server": {
        "hostname": "192.168.1.113"
    }
}

Markdown - (markdown: {})

  • Type: string
  • Default: {}

Change the theme of codeblock sytanx:

{
    "markdown": {
        "theme": "github-dark"
    }
}

Redpoint uses Shiki theme library for themes, you find the available list of themes on their documentation: https://shiki.style/themes#bundled-themes

Redirects - (redirects: {})

  • Type: string
  • Default: {}
{
    "redirects": {
        "/old-page": "/new-page",
        "/login": "/account/login"
    }
}

Layouts - (layouts: {})

  • Type: string
  • Default: {}`

This is designed for Markdown files only, so you can change the layout for each Markdown file.

import BaseLayout from "./src/layouts/Base.tsx"
import ArticleLayout from "./src/layouts/Article.tsx"
{
    "layouts": {
        "default": BaseLayout,
        "article": ArticleLayout
    }
}

In the frontmatter, of your Markdown file, you'll add the layout option:

layout: "article"

Middleware - (middleware: [])

  • Type: any
  • Default: {}

Example:

{
    "middleware": [
        (request: { method: any; url: any; }) => {
            console.log(`${request.method} ${request.url}`)
            return null
        }
    ]
}

Security

Allowed Hosts - (security.allowedHosts)

  • Type: string | string[]
  • Default: []

List of hostnames that Redpoint is allowed to respond to. When the value is set to true, any hostname is allowed.

{
    "security": {
        "allowedHosts": [
          "https://example.org",
          "https://example.dev"
        ]
    }
}

Rate Limits - (security.rateLimits)

{
    "security": {
        "rateLimits": {
            "rate": 100,
            "windowMs": 60000
        }
    }
}

Routes and Credentials - (security.routes)

Set credentials for a routing path.

{
  "security": {
    "routes": {
      "/admin": {
        "credentials": [
          {
            "username": "admin",
            "password": "p@S$w0rd"
          },
          {
            "username": "johny.s",
            "password": "99br!dgeDown"
          }
        ]
      },
      "/stats": {
        "credentials": {
          "username": "johny.s",
          "password": "99br!dgeDown"
        }
      }
    }
  }
}