IHP Api Reference
Copyright(c) digitally induced GmbH 2021
Safe HaskellNone

IHP.FileStorage.Config

Description

 
Synopsis

Documentation

initS3Storage :: Text -> Text -> StateT TMap IO () Source #

The AWS access key and secret key have to be provided using the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars.

Example: Set up a s3 storage in Config.hs

module Config where

import IHP.Prelude
import IHP.Environment
import IHP.FrameworkConfig
import IHP.FileStorage.Config

config :: ConfigBuilder
config = do
    option Development
    option (AppHostname "localhost")
    initS3Storage "eu-central-1" "my-bucket-name"

initStaticDirStorage :: StateT TMap IO () Source #

Stores files publicly visible inside the static directory

Example: Store uploaded files in the static/ directory

module Config where

import IHP.Prelude
import IHP.Environment
import IHP.FrameworkConfig
import IHP.FileStorage.Config

config :: ConfigBuilder
config = do
    option Development
    option (AppHostname "localhost")
    initStaticDirStorage

initMinioStorage :: Text -> Text -> StateT TMap IO () Source #

The Minio access key and secret key have to be provided using the MINIO_ACCESS_KEY and MINIO_SECRET_KEY env vars.

Example: Set up a minio storage in Config.hs

module Config where

import IHP.Prelude
import IHP.Environment
import IHP.FrameworkConfig
import IHP.FileStorage.Config

config :: ConfigBuilder
config = do
    option Development
    option (AppHostname "localhost")
    initMinioStorage "https://minio.example.com" "my-bucket-name"