-
Notifications
You must be signed in to change notification settings - Fork 1
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 #123 from ngyn-rs/dev
v0.4.1 - Injection fixes
- Loading branch information
Showing
18 changed files
with
340 additions
and
1,457 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,5 @@ | ||
use proc_macro::TokenStream; | ||
|
||
pub(crate) fn inject_macro(_args: TokenStream, raw_input: TokenStream) -> TokenStream { | ||
raw_input | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub mod check_macro; | ||
pub mod controller_macro; | ||
pub mod inject_macro; | ||
pub mod injectable_macro; | ||
pub mod route_macro; | ||
pub mod routes_macro; |
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
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
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 |
---|---|---|
@@ -1,25 +1,21 @@ | ||
mod modules; | ||
|
||
use modules::sample::sample_module::SampleModule; | ||
use ngyn::{ | ||
platforms::{NgynApplication, Result}, | ||
prelude::*, | ||
}; | ||
use ngyn::prelude::*; | ||
use ngyn_hyper::HyperApplication; | ||
|
||
#[ngyn::macros::main] | ||
async fn main() -> Result<()> { | ||
let mut app = NgynFactory::<NgynApplication>::create::<SampleModule>(); | ||
#[tokio::main] | ||
async fn main() { | ||
let mut app = NgynFactory::<HyperApplication>::create::<SampleModule>(); | ||
|
||
app.get( | ||
"/author", | ||
|_req: &mut NgynRequest, res: &mut NgynResponse| { | ||
|_cx: &mut NgynContext, res: &mut NgynResponse| { | ||
res.send("Ngyn is created by @elcharitas."); | ||
}, | ||
); | ||
|
||
println!("Starting server at http://127.0.0.1:8080"); | ||
|
||
app.listen("0.0.0.0:8080").await?; | ||
|
||
Ok(()) | ||
let _ = app.listen("0.0.0.0:8080").await; | ||
} |
Oops, something went wrong.