Pode
ReleasesGitHub
  • Introduction
  • Getting Started
    • Installation
    • CLI
    • Docker
    • Frontend
  • Tutorials
    • Routes
  • Functions
    • Attach
    • Engine
    • Listen
    • Server
    • Status
    • View
Powered by GitBook
On this page
  • Description
  • Examples
  • Parameters
  1. Functions

Attach

Description

The attach function allows you to attach file in the /public directory onto the web response. This allows the files to be downloaded by the end-user.

Examples

  1. The following example attaches the installer found at /public/downloads/installer.exe onto the response, when the http://localhost:8080/app/install endpoint is hit:

     Server {
         listen *:8080 http
    
         route get '/app/install' {
             attach 'downloads/installer.exe'
         }
     }

Parameters

Name

Type

Required

Description

Default

Path

string

true

The path to the file to attach, relative to your /public directory

null

PreviousRoutesNextEngine

Last updated 6 years ago