Skip to content

Commit 437027a

Browse files
author
richard
committed
Request Page From Another Module
1 parent cbb1983 commit 437027a

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

sample/Modules/AnotherModule.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Carter.HtmlNegotiator.Sample.Modules
2+
{
3+
using Response;
4+
5+
public class AnotherModule : CarterModule
6+
{
7+
public AnotherModule() : base("/another")
8+
{
9+
Get("/",
10+
async (req, res, routeData) =>
11+
{
12+
await res.Negotiate(new {title = "Hello World!", message = "Hello from Another Module!"});
13+
});
14+
}
15+
}
16+
}

sample/Views/Another/index.hbs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>{{title}}</title>
5+
</head>
6+
<body>
7+
<h1>{{message}}</h1>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)