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
200
Issues
200
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
...
@@ -44,40 +44,37 @@ instance ParseField Mode
instance
ParseFields
Mode
instance
ParseFields
Mode
data
MyOptions
w
=
MyOptions
{
run
::
w
:::
Mode
<?>
"Possible modes: Dev | Mock | Prod"
data
MyOptions
w
=
,
port
::
w
:::
Maybe
Int
<?>
"By default: 8008"
MyOptions
{
run
::
w
:::
Mode
,
ini
::
w
:::
Maybe
Text
<?>
"Ini-file path of gargantext.ini"
<?>
"Possible modes: Dev | Mock | Prod"
}
,
port
::
w
:::
Maybe
Int
deriving
(
Generic
)
<?>
"By default: 8008"
,
ini
::
w
:::
Maybe
Text
<?>
"Ini-file path of gargantext.ini"
}
deriving
(
Generic
)
instance
ParseRecord
(
MyOptions
Wrapped
)
instance
ParseRecord
(
MyOptions
Wrapped
)
deriving
instance
Show
(
MyOptions
Unwrapped
)
deriving
instance
Show
(
MyOptions
Unwrapped
)
main
::
IO
()
main
::
IO
()
main
=
do
main
=
do
MyOptions
myMode
myPort
myIniFile
<-
unwrapRecord
MyOptions
myMode
myPort
myIniFile
<-
unwrapRecord
"Gargantext: collaborative platform for text-mining"
"Gargantext server"
let
myPort'
=
case
myPort
of
let
myPort'
=
case
myPort
of
Just
p
->
p
Just
p
->
p
Nothing
->
8008
Nothing
->
8008
let
start
=
case
myMode
of
let
start
=
case
myMode
of
--Nothing -> startGargantext myPort' (unpack myIniFile')
Prod
->
startGargantext
myPort'
(
unpack
myIniFile'
)
Prod
->
startGargantext
myPort'
(
unpack
myIniFile'
)
where
where
myIniFile'
=
case
myIniFile
of
myIniFile'
=
case
myIniFile
of
Nothing
->
panic
"[ERROR] gargantext.ini needed"
Nothing
->
panic
"For Prod mode, you need to fill a gargantext.ini file"
Just
i
->
i
Just
i
->
i
_
->
startGargantextMock
myPort'
Mock
->
startGargantextMock
myPort'
_
->
startGargantextMock
myPort'
putStrLn
$
"Starting with "
<>
show
myMode
<>
" mode."
start
putStrLn
$
"Starting Gargantext with mode: "
<>
show
myMode
start
-- main' :: IO ()
--main' = putStrLn $ show $ M.conditional $ M.myMat 10
src/Gargantext/API/Ngrams.hs
View file @
dc3afe64
...
@@ -472,7 +472,7 @@ data Versioned a = Versioned
...
@@ -472,7 +472,7 @@ data Versioned a = Versioned
{
_v_version
::
Version
{
_v_version
::
Version
,
_v_data
::
a
,
_v_data
::
a
}
}
deriving
(
Generic
)
deriving
(
Generic
,
Show
)
deriveJSON
(
unPrefix
"_v_"
)
''
V
ersioned
deriveJSON
(
unPrefix
"_v_"
)
''
V
ersioned
makeLenses
''
V
ersioned
makeLenses
''
V
ersioned
instance
ToSchema
a
=>
ToSchema
(
Versioned
a
)
instance
ToSchema
a
=>
ToSchema
(
Versioned
a
)
...
@@ -758,6 +758,6 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset = do
...
@@ -758,6 +758,6 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset = do
limit_
=
maybe
defaultLimit
identity
mlimit
limit_
=
maybe
defaultLimit
identity
mlimit
offset_
=
maybe
0
identity
moffset
offset_
=
maybe
0
identity
moffset
getListNgrams
listIds
ngramsType
getListNgrams
([
104
]
<>
listIds
)
ngramsType
&
mapped
.
v_data
.
_NgramsTable
%~
(
take
limit_
.
drop
offset_
)
&
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