Using Workbox via a local copy, without a CDN - vue.js

I have a small device that serves a webpage using Nginx in a local network. I'm developing the webpage using Vue and I need that once a person got connected to the server and visited the page, on disconnection, the page needs to work as normal
I'm currently using Workbox plugin and I get this code:
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/precache-manifest.b62cf508e2c3da8c27f2635f7aab384a.js"
);
The problem is that it goes to the internet to download that file and I will not have an internet connection.
I tried downloading this file, but inside goes to the internet again.
Is there a way to get this to work in an offline environment?

You can follow the guidance in the workbox-sw docs to download a local copy of the bundled Workbox runtime libraries, and modify your service worker script to use those.
Running:
$ npx workbox-cli#4.3.1 copyLibraries /path/to/dir
from the command line will download a local copy of the runtime to the specified directory (replace /path/to/dir with the desired location).
You can then modify your service worker script so that it reads:
importScripts("/path/to/dir/workbox-v4.3.1/workbox-sw.js");
workbox.setConfig({
modulePathPrefix: '/path/to/dir/workbox-v4.3.1/'
});
importScripts(
"/precache-manifest.b62cf508e2c3da8c27f2635f7aab384a.js"
);

Related

Wrangler local development with Cloudflare Pages

I'm playing around with the new Cloudflare Functions functionality, specifically the file based routing. However I've found it tiresome to have to deploy and debug my functions in the cloud
I found this, which seems to say I can use Wrangler to connect to the Cloudfalre network and run functions locally:
https://developers.cloudflare.com/pages/platform/functions/#develop-and-preview-locally
But it keeps asking me for a root worker file: but there is no root file, its file based routing.
How do I get Cloudsflare Functions to work with wrangler local dev or miniflare?

How to configure Redis cache on local?

I have implemented Redis cache with .net core 2.1 application. Now the issue is I have only development connection string. I want to configure and test Redis cache somehow on my local pc. I have read somewhere that it is possible using chocalatey. So can body refer me any link?
PS: When I tried to run redis cache from development server using vpn, It shown me popup to select "ResultBox.cs" file. So I created new ResultBox.cs file and give it the path, but when I call rediscache.Get() method it opens ResultBox.cs file but nothing happens then. Can anybody tell what is ResultBox.cs for?
I have found a way to configure Redis on local using chocolatey. Use this link. If you face Misconf issues while testing on redis-cli this link will be helpful.
You can run a local docker redis image. See this and this for reference.

Move files from node.js to apache server

Is there any possible for moving files from platform like Heroku to second server like Apache? I want to create application and push it to Heroku, but I have also Apache server and I want send to this server all images which I upload from frontend forms.
EDIT
ok so You want to use Heroku as the main application server. But then Heroku makes HTTP/HTTPS requests to the Apache server?
I think thats what you are asking.
Yeah no issues with that. if you want to set up API id go with Laravel 5.3 and use its passport function on your Apache server ( but this is not required, this is only for security.)
https://laravel.com/docs/5.3/passport
END OF EDIT
what the web server is really does not matter at all.
Its about if the server has internet access and im pretty sure they do.
Easiest way is ftp,SSH,or git. unless they both have a web server then id just zip up your app without the node_modules folder and move it into the web directory. then go to the address of your server in a web browser. eg. http://mywebsite.com/files-i-just-zipped.zip and download them. (i normally log onto the new server via SSH and do wget http://mywebsite.com/files-i-just-zipped.zip)
I need more info but yeah. once you unzip then you need to install node but my guess is they already have it.
then do npm install in the package.json directory.

qooxdoo's api-viewer run offline

I dont know how to make qooxdoo's api-viewer run offline.
http://www.qooxdoo.org/current/apiviewer/#
Any help?
just run generate with the api target and you get a local copy of the api viewer wich also documeents your own project.
./generate.py api
then start a local web server in the newly generated api directory
cd api
python -mSimpleHTTPServe
and open http://localhost:8000

Bluemix VMs on eu-gb: OS_TENANT_ID missing from CLI file

VMs is up on eu-gb region which is great.
However Horizon does not appear to be installed on there, which is fine, as I use the CLI most of the time. However the CLI file that I download from the Bluemix console is not correct.
It is missing the OS_TENANT_ID property. I cannot connect to my OpenStack tenant without this. Where can I get tenant ID from?
according to Bluemix VM documentation
https://www.ng.bluemix.net/docs/virtualmachines/vm_index.html#vm_setup_cli
you should login into your region&org and download the rc file one you are going to create the first VM.
The rc file download following these steps will contain all the information you need to access and manage your VM on Bluemix using openstack client.
In the case of you already downloaded your rc file following these steps I suggest you to try again generating a new one to check the new one contains all the information you need (consider that this environment is still beta and this kind of issues could be expected)