Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Katharina Fey
forge
Commits
5e85e049
Commit
5e85e049
authored
Apr 25, 2019
by
Katharina Fey
🏴
Browse files
Hooking up server code
parent
26de62ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/forgectl.rs
View file @
5e85e049
use
clap
::{
App
,
AppSettings
,
Arg
,
SubCommand
};
use
forge
::{
hash
,
secret
,
setup
};
use
forge
::{
hash
,
secret
,
server
,
setup
};
fn
main
()
{
let
app
=
App
::
new
(
"forge-cli"
)
...
...
@@ -51,12 +51,18 @@ fn main() {
.long
(
"file"
)
.help
(
"Provide a file name"
),
),
)
.subcommand
(
SubCommand
::
with_name
(
"run"
)
.about
(
"Run the forge server"
)
.version
(
server
::
VERSION
),
);
match
app
.get_matches
()
.subcommand
()
{
(
"hash"
,
Some
(
m
))
=>
hash
::
run
(
m
),
(
"encrypt"
,
Some
(
m
))
=>
secret
::
run
(
m
),
(
"setup"
,
Some
(
m
))
=>
setup
::
run
(
m
),
(
"run"
,
_
)
=>
server
::
run
(),
_
=>
unreachable!
(),
}
}
src/server.rs
View file @
5e85e049
...
...
@@ -5,6 +5,9 @@ mod utils {
pub
use
crate
::
*
;
}
/// The module version
pub
const
VERSION
:
&
'static
str
=
"0.1.0"
;
#[derive(Clone)]
struct
Params
{
bind
:
String
,
...
...
@@ -50,7 +53,7 @@ fn index(state: web::Data<Params>, req: HttpRequest) -> HttpResponse {
}
}
pub
fn
mai
n
()
{
pub
fn
ru
n
()
{
let
params
=
Params
::
new
();
let
bind
=
params
.bind
.clone
();
...
...
Write
Preview
Supports
Markdown
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