HUB
Sign inSign up
micro-portalen-links logo

telemark/micro-portalen-links

By telemark

•Updated over 6 years ago

Mapping of links for portalen

Image
0

2.4K

telemark/micro-portalen-links repository overview

Build Status js-standard-style

Microservice for portalen links.

Returns an array of links based on roles and ip.

⁠API

Lists all shortcuts

To filter by roles

⁠GET
?roles=<role1>|<role2>|<role3>
⁠POST
{
  roles: [
    'role1',
    'role2',
    'role3'
  ]
}

⁠/view

Renders html of all links

To filter by roles

⁠GET
?roles=<role1>|<role2>|<role3>
⁠POST
{
  roles: [
    'role1',
    'role2',
    'role3'
  ]
}
$ curl http://localhost:3000/links -d '{"roles": ["skole"]}' --header "Content-Type: application/json"

To filter by ip

⁠GET
?myIp=127.0.0.1
⁠POST
{
  myIp: '127.0.0.1'
}

⁠Development

⁠Development

You'll need the now-cli⁠ installed to do local development.

  • Clone the repo
  • Install the dependencies $ npm i
  • Start the development server $ npm run dev
  • Open the .json-file for the role you will add the link for lib/data/⁠
  • Add the link
  {
      "title": "The links title",
      "description": "Links description (keep it short)",
      "system": "What system is the link leading to",
      "url": "Url for the link",
      "icon": "Name for the link icon", // From https://material.io/resources/icons/?style=baseline
      "includeIps": [
        "10.0.*.*", // Support wildcards for range
        "172.16.0.0" // Supports full address
      ] //This optional. Must be an array. If the shortcut is available for all IPs remove the property
    }
  • Redeploy

⁠Deploy

Make sure the now.json⁠ matches your environment.

Run the deploy script.

$ npm run deploy

⁠License

MIT⁠

Tag summary

Content type

Image

Digest

Size

18.4 MB

Last updated

over 6 years ago

docker pull telemark/micro-portalen-links