Skip to content

hasangenc0/microfrontends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Releases

No releases published

Packages