Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
dc3afe64
Commit
dc3afe64
authored
Feb 12, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EXE] cosmetics.
parent
ca9f9baf
Pipeline
#190
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
32 deletions
+29
-32
Main.hs
bin/gargantext-server/Main.hs
+27
-30
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+2
-2
No files found.
bin/gargantext-server/Main.hs
View file @
dc3afe64
...
...
@@ -44,40 +44,37 @@ instance ParseField Mode
instance
ParseFields
Mode
data
MyOptions
w
=
MyOptions
{
run
::
w
:::
Mode
<?>
"Possible modes: Dev | Mock | Prod"
,
port
::
w
:::
Maybe
Int
<?>
"By default: 8008"
,
ini
::
w
:::
Maybe
Text
<?>
"Ini-file path of gargantext.ini"
}
deriving
(
Generic
)
data
MyOptions
w
=
MyOptions
{
run
::
w
:::
Mode
<?>
"Possible modes: Dev | Mock | Prod"
,
port
::
w
:::
Maybe
Int
<?>
"By default: 8008"
,
ini
::
w
:::
Maybe
Text
<?>
"Ini-file path of gargantext.ini"
}
deriving
(
Generic
)
instance
ParseRecord
(
MyOptions
Wrapped
)
deriving
instance
Show
(
MyOptions
Unwrapped
)
main
::
IO
()
main
=
do
MyOptions
myMode
myPort
myIniFile
<-
unwrapRecord
"Gargantext: collaborative platform for text-mining"
let
myPort'
=
case
myPort
of
Just
p
->
p
Nothing
->
8008
let
start
=
case
myMode
of
--Nothing -> startGargantext myPort' (unpack myIniFile')
Prod
->
startGargantext
myPort'
(
unpack
myIniFile'
)
where
myIniFile'
=
case
myIniFile
of
Nothing
->
panic
"For Prod mode, you need to fill a gargantext.ini file"
Just
i
->
i
Mock
->
startGargantextMock
myPort'
_
->
startGargantextMock
myPort'
putStrLn
$
"Starting Gargantext with mode: "
<>
show
myMode
start
-- main' :: IO ()
--main' = putStrLn $ show $ M.conditional $ M.myMat 10
main
=
do
MyOptions
myMode
myPort
myIniFile
<-
unwrapRecord
"Gargantext server"
let
myPort'
=
case
myPort
of
Just
p
->
p
Nothing
->
8008
let
start
=
case
myMode
of
Prod
->
startGargantext
myPort'
(
unpack
myIniFile'
)
where
myIniFile'
=
case
myIniFile
of
Nothing
->
panic
"[ERROR] gargantext.ini needed"
Just
i
->
i
_
->
startGargantextMock
myPort'
putStrLn
$
"Starting with "
<>
show
myMode
<>
" mode."
start
src/Gargantext/API/Ngrams.hs
View file @
dc3afe64
...
...
@@ -472,7 +472,7 @@ data Versioned a = Versioned
{
_v_version
::
Version
,
_v_data
::
a
}
deriving
(
Generic
)
deriving
(
Generic
,
Show
)
deriveJSON
(
unPrefix
"_v_"
)
''
V
ersioned
makeLenses
''
V
ersioned
instance
ToSchema
a
=>
ToSchema
(
Versioned
a
)
...
...
@@ -758,6 +758,6 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset = do
limit_
=
maybe
defaultLimit
identity
mlimit
offset_
=
maybe
0
identity
moffset
getListNgrams
listIds
ngramsType
getListNgrams
([
104
]
<>
listIds
)
ngramsType
&
mapped
.
v_data
.
_NgramsTable
%~
(
take
limit_
.
drop
offset_
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment