This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1101 from ethcore/apps-api
Apps listing API & Home webapp.
- Loading branch information
Showing
11 changed files
with
212 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ name = "ethcore-webapp" | |
version = "1.2.0" | ||
license = "GPL-3.0" | ||
authors = ["Ethcore <[email protected]"] | ||
build = "build.rs" | ||
|
||
[lib] | ||
|
||
|
@@ -13,15 +14,24 @@ jsonrpc-core = "2.0" | |
jsonrpc-http-server = { git = "https://github.com/ethcore/jsonrpc-http-server.git" } | ||
hyper = { default-features = false, git = "https://github.com/ethcore/hyper" } | ||
url = "1.0" | ||
rustc-serialize = "0.3" | ||
serde = "0.7.0" | ||
serde_json = "0.7.0" | ||
serde_macros = { version = "0.7.0", optional = true } | ||
ethcore-rpc = { path = "../rpc" } | ||
ethcore-util = { path = "../util" } | ||
parity-webapp = { git = "https://github.com/ethcore/parity-webapp.git" } | ||
parity-webapp = { git = "https://github.com/ethcore/parity-webapp.git", version = "0.2" } | ||
# List of apps | ||
parity-status = { git = "https://github.com/ethcore/parity-status.git", version = "0.4.1" } | ||
parity-idmanager = { git = "https://github.com/ethcore/parity-idmanager-rs.git", version = "0.1.3" } | ||
parity-wallet = { git = "https://github.com/ethcore/parity-wallet.git", version = "0.3.0", optional = true } | ||
parity-status = { git = "https://github.com/ethcore/parity-status.git", version = "0.4.3" } | ||
parity-idmanager = { git = "https://github.com/ethcore/parity-idmanager-rs.git", version = "0.2.2" } | ||
parity-wallet = { git = "https://github.com/ethcore/parity-wallet.git", version = "0.4.0", optional = true } | ||
clippy = { version = "0.0.67", optional = true} | ||
|
||
[build-dependencies] | ||
serde_codegen = { version = "0.7.0", optional = true } | ||
syntex = "0.32.0" | ||
|
||
[features] | ||
default = ["parity-wallet"] | ||
default = ["parity-wallet", "serde_codegen"] | ||
nightly = ["serde_macros"] | ||
dev = ["clippy", "ethcore-rpc/dev", "ethcore-util/dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#[cfg(not(feature = "serde_macros"))] | ||
mod inner { | ||
extern crate syntex; | ||
extern crate serde_codegen; | ||
|
||
use std::env; | ||
use std::path::Path; | ||
|
||
pub fn main() { | ||
let out_dir = env::var_os("OUT_DIR").unwrap(); | ||
|
||
let src = Path::new("./src/api/mod.rs.in"); | ||
let dst = Path::new(&out_dir).join("mod.rs"); | ||
|
||
let mut registry = syntex::Registry::new(); | ||
|
||
serde_codegen::register(&mut registry); | ||
registry.expand("", &src, &dst).unwrap(); | ||
} | ||
} | ||
|
||
#[cfg(feature = "serde_macros")] | ||
mod inner { | ||
pub fn main() {} | ||
} | ||
|
||
fn main() { | ||
inner::main(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! REST API | ||
#![warn(missing_docs)] | ||
#![cfg_attr(feature="nightly", feature(custom_derive, custom_attribute, plugin))] | ||
#![cfg_attr(feature="nightly", plugin(serde_macros, clippy))] | ||
|
||
#[cfg(feature = "serde_macros")] | ||
include!("mod.rs.in"); | ||
|
||
#[cfg(not(feature = "serde_macros"))] | ||
include!(concat!(env!("OUT_DIR"), "/mod.rs")); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
mod api; | ||
mod response; | ||
|
||
pub use self::api::RestApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2015, 2016 Ethcore (UK) Ltd. | ||
// This file is part of Parity. | ||
|
||
// Parity is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Parity is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
use serde::Serialize; | ||
use serde_json; | ||
use endpoint::{ContentHandler, Handler}; | ||
|
||
pub fn as_json<T : Serialize>(val: &T) -> Box<Handler> { | ||
Box::new(ContentHandler::new(serde_json::to_string(val).unwrap(), "application/json".to_owned())) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters