Config.purs 1.58 KB
Newer Older
1 2
module Gargantext.Config where

3 4 5
import Data.NonEmpty (NonEmpty, (:|), head)
import Gargantext.Ends
import Gargantext.Types (ApiVersion(..))
Nicolas Pouillard's avatar
Nicolas Pouillard committed
6

James Laver's avatar
James Laver committed
7
defaultBackends :: NonEmpty Array Backend
8
defaultBackends = local :| [prod, partner, demo, dev]
James Laver's avatar
James Laver committed
9
  where
10 11
    prod    = backend V10 "/api/" "https://v4.gargantext.org"   "iscpif.cnrs"
    partner = backend V10 "/api/" "https://demo.gargantext.org" "institut-mines-telecom.imt"
12 13
    demo    = backend V10 "/api/" "https://demo.gargantext.org" "demo.inshs.cnrs"
    dev     = backend V10 "/api/" "https://dev.gargantext.org"  "devel.inshs.cnrs"
14
    local   = backend V10 "/api/" "http://localhost:8008"       "local.cnrs"
15

16
defaultApps :: NonEmpty Array Frontend
17
defaultApps = relative :| [prod, dev, demo, haskell, caddy]
James Laver's avatar
James Laver committed
18
  where
James Laver's avatar
James Laver committed
19
    relative = frontend "/#/" "" "Relative"
20
    prod     = frontend "/#/" "https://v4.gargantext.org" "v4.gargantext.org"
21 22
    dev      = frontend "/#/" "https://dev.gargantext.org" "gargantext.org (dev)"
    demo     = frontend "/#/" "https://demo.gargantext.org" "gargantext.org (demo)"
23
    haskell  = frontend "/#/" "http://localhost:8008" "localhost.gargantext"
24 25
    python   = frontend "/#/" "http://localhost:8000" "localhost.python"
    caddy    = frontend "/#/" "http://localhost:2015" "localhost.caddy"
James Laver's avatar
James Laver committed
26 27 28 29 30 31

defaultStatics :: NonEmpty Array Frontend
defaultStatics = relative :| []
  where
    relative = frontend "" "/" "relative"

32 33
defaultApp :: Frontend
defaultApp = head defaultApps
34

35 36
defaultStatic :: Frontend
defaultStatic = head defaultStatics
37

38 39
defaultFrontends :: Frontends
defaultFrontends = Frontends { app: defaultApp, static: defaultStatic }
40