-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hook for initializing subapp Server code (#1851)
- Loading branch information
Showing
8 changed files
with
124 additions
and
3 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
packages/subapp-server/test/data/fastify-plugin-test/demo3/app.js
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,17 @@ | ||
import { loadSubApp } from "subapp-react"; | ||
|
||
const Demo3 = () => { | ||
return ( | ||
<div style={{ padding: "5px", border: "solid", marginLeft: "15%", marginRight: "15%" }}> | ||
<p>subapp demo3</p> | ||
<p> | ||
<a href="https://wmlink.wal-mart.com/electrode">Electrode Docs</a> | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default loadSubApp({ | ||
Component: Demo3, | ||
name: "Demo3" | ||
}); |
13 changes: 13 additions & 0 deletions
13
packages/subapp-server/test/data/fastify-plugin-test/demo3/server.js
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,13 @@ | ||
module.exports = { | ||
setup(server) { | ||
server.route({ | ||
path: "/api/demo3/testsetup", | ||
method: "GET", | ||
handler: function (request, reply) { | ||
reply.send({ | ||
msg: "Route set by subappServer" | ||
}); | ||
} | ||
}); | ||
} | ||
}; |
6 changes: 6 additions & 0 deletions
6
packages/subapp-server/test/data/fastify-plugin-test/demo3/subapp-manifest.js
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,6 @@ | ||
module.exports = { | ||
type: "app", | ||
entry: "./app.js", | ||
serverEntry: "./server.js", | ||
name: "demo3" | ||
}; |
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