Nodejs Solid Server on mobile

So you mean something like a local server?

If yes, you could take a look at solid-rest by @jeffz. The goal of this package is to wrap a custom storage so that it behaves according to the solid api-spec. I think it supports everything from it, except for Sparql and OPTIONs requests. And some things like permission handling via Acl file are not included (they aren’t part of the api-spec).

You can give solid-rest a custom backend, but it already has a localStorage (which falls back to in-memory storage using objects if not available) and fileStorage (using fs). It is used in solid-auth-cli and there are plans to include it in solid-auth-client too if I remember correctly.

Here’s a short usage example

const SolidRest = require('solid-rest/src/rest');
const RestLocalStorage = require('solid-rest/src/localStorage')
const myLocalStorage = new RestLocalStorage()
// Defaults to ls which makes it usable as app://ls/some/path/
myLocalStorage.prefix = 'ls'
const localRest = new SolidRest([ myLocalStorage ])

// Now you can fallback to using rest
localRest.fetch('app://ls/') // The root folder app://ls/ already exists
    .then(async res => {
        console.log(res.status) // 200
        console.log(res.headers.get('Content-Type')) // text/turtle
        console.log(await res.text()) // "@prefix ldp: <http://www.w3.org/ns/ldp#>.\n<> a ldp:BasicContainer, ldp:Container.\n"
    })
    .catch(console.error)

I’ve also played with the thought to create a browser extension which gives the user the ability to create a local pod and proxies “https://solid.pod.local/” to be handled by solid-rest, but I didn’t find a way to do this kind of proxy with web extensions until now. Here’s the thread: Create local in-browser pod