Giter Site home page Giter Site logo

Comments (5)

panaaj avatar panaaj commented on August 16, 2024

This is the remaining feature where Freeboard behaviour is detecting the server type and using:
Node server = /webapps
Artemis server /signalk/v1/apps/list
urls to retrieve a list of webapps.

A request is sent to the appropriate url and the response expected to be consistent across servers...

The response is expected to have the following keys:

{ 
   name: ..., , 
   description: ... ,
   _location: ..., 
}

which are used to compile the target url as follows:

if(!_location) { url= `/` + name }
else { url= _location }

KIP entry returned by node-server looks like this... so you can see the "_location": "/@mxtommy/kip" is used for the url.

{
	"_from": "@mxtommy/[email protected]",
	"_id": "@mxtommy/[email protected]",
	"_inBundle": false,
	"_integrity": "sha512-NBJjKmpw34AHJOzxJlXoFVj8I/77vm+DAheJLAX74wAlTuzeLjBf8pIh2IWpw0XejHurApTahN6y5D8avXuOBw==",
	"_location": "/@mxtommy/kip",
        "name": "@mxtommy/kip",
        "description": "This is an instrumentation package to display signalK data. Display can be split up in any arrangement to show all data available on the server.",
	"_phantomChildren": {},
	"_requested": {
		"type": "version",
		"registry": true,
		"raw": "@mxtommy/[email protected]",
		"name": "@mxtommy/kip",
		"escapedName": "@mxtommy%2fkip",
		"scope": "@mxtommy",
		"rawSpec": "0.1.8",
		"saveSpec": null,
		"fetchSpec": "0.1.8"
	},  
        ....

Can you provide a sample of what Artemis server returns for KIP.

This is clearly a server behaviour that should be documented in the spec so consistent behavour is experienced by client applications.

from freeboard-sk.

rob42 avatar rob42 commented on August 16, 2024

Yes a spec addition is needed. I thought we already agreed on path signalk/v1/apps with list, search,install, remove. /webapps was just the early node custom implementation? I will make a PR for the spec.

I will alter my signalk/v1/apps/list to return:

{ 
   name: ..., , 
   description: ... ,
   _location: ..., 
}

from freeboard-sk.

rob42 avatar rob42 commented on August 16, 2024

Hmm, _location seems oddly named, location or href (which I have) seems better. Any idea why the _ ?
I will include both _location and href for now.

from freeboard-sk.

rob42 avatar rob42 commented on August 16, 2024

Artemis is now returning:

[{
	"_location": "../@mxtommy/kip/package/public/index.html",
	"licence": "",
	"author": "Thomas St.Pierre <[email protected]>",
	"name": "Kip",
	"description": "",
	"href": "../@mxtommy/kip/package/public/index.html",
	"repository": "https://github.com/npm/npm.git",
	"version": "0.1.8"
},
....
]

from freeboard-sk.

rob42 avatar rob42 commented on August 16, 2024

Thanks, it works!!
Closing now

from freeboard-sk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.