Skip to content

hasangenc0/microfrontends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

17d555b · Dec 17, 2019

History

14 Commits
Jul 19, 2019
Jul 19, 2019
Sep 27, 2019
Sep 27, 2019
Dec 17, 2019
Jul 19, 2019
Sep 18, 2019
Sep 18, 2019
Dec 17, 2019
Sep 27, 2019

Repository files navigation

Microfrontends

This project is under development

go get github.com/hasangenc0/microfrontends

Usage

Look at the examples folder

Running Examples
cd examples
sh run.sh
Define your microservice gateways
gateways := []microfrontends.Gateway{
    {
        Name: "header",
        Host: "http://localhost",
        Port: "4462",
        Method: "GET",
    },
    {
        Name: "footer",
        Host: "http://localhost",
        Port: "4463",
        Method: "GET",
    },
    {
        Name: "content",
        Host: "http://localhost",
        Port: "4461",
        Method: "POST",
    },
}
Define your default page
page := microfrontends.Page{
    Name: "App",
    Content: `
        <html>
        <body>
            <chunk name="header"></chunk>
            <chunk name="content"></chunk>
            <chunk name="footer"></chunk>
        </body>
        </html>
    `,
}
Create microfrontends app and run it
app := microfrontends.App{
    gateways,
    page,
    w,
}

app.Init()

Author

Hasan Genc