Disable CDN through PowerShell - powershell

I built a React Typescript project in SharePoint.
I'm currently getting errors with how the CDN is serving up the content.
I want to disable CDN all together across all tenants.
Right now when I run:
Get-SPOTenantCdnEnabled -CdnType Public
I get back True
I just want a way to disable CDN. I found this article here but I'm having trouble with the command: https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/remove-spotenantcdnorigin?view=sharepoint-ps
Remove-SPOTenantCdnOrigin -CdnType Public -OriginUrl sites/pubsite/siteassets/subfolder
I'm just not too sure what to put in the sites/pubsite/siteassets/subfolder section.
So all I'm trying to do is disable CDN on all tenants, I was following a tutorial and accidentally turned it on.

If you just want to disable the CDN option for a tenant without modifying the defined CDN providers, use Set-SPOTenantCdnEnabled:
Set-SPOTenantCdnEnabled -CdnType Both -Enable:$false

Related

how to load workbench ui in vscode extension

I'm developing a vscode extension, and I'm currently facing a problem, and I'd like to seek your help.
I want to use the VScode UI in the webview created by the plug-in to ensure the consistency of the user's vision. How do I refer to the resource?
I tried the following:
Use appRoot to directly splice vscode-file://vscode-app/, displaying network errors
Use appRoot to refer to 'file://' and find: Not allowed to load local resource
Use asWebviewUri, display HTTP code 401
const cssfile = vscode.Uri.file(path.join(vscode.env.appRoot,"out/vs/workbench/workbench.desktop.main.css"));
const cssurl = this.view.webview.asWebviewUri(cssfile);
console.log(cssurl);
I found the reason through the official documentation, because of security restrictions, you need to add approot to the settings.
Use the WebviewOptions.localResourceRoots to allow access to additional local resources.
https://code.visualstudio.com/api/extension-guides/webview#loading-local-content

How to add extension to apigee-emulator on local environment?

Recently we get the need for work on the same apigee proxy more than one developer. So we are trying to use the apigee-emulator to allow us to use git as version control
We already have everything setup for VScode as it says on the documentation.
The problem is with an `extension callout we have inside one of our proxies that we need to access to salesforce. When we try to push our proxies to the apigee-emulator we get this error
If we search for the callout we can see it's the one that try to access to salesforce
How can we add this extension to be used inside the apigee-emulator?
From the error it looks like you are using Apigee Edge ExtensionCallout policy.
The vscode extension and the emulator cater towards the features available in the X and hybrid versions of Apigee. More information here
The extensions feature you are using has been replaced by the Integration callout policy.
Hope that helps

Error: 404 The page you're looking for could not be found (gitlab). How to resolve it?

Let's say I have some website with the name website.eu. When I deploy it and try to get access to a page online like this website.eu/about I catch the error:
"404 The page you're looking for could not be found. The resource that you are attempting to access does not exist or you don't have the necessary permissions to view it"
When I click on the link that brings me a website.eu/about it works well, but trying to type that URL in the input field it fails.
Everything works fine locally.
The project is developed using Vue3.
The project is no GitLab.
If someone helps I would appreciate it.
Hard to tell without seeing the code, but my guess is your router setup uses the web history mode, which relies on the server to have certain settings applied.
I believe switching to hash mode (while adding # to the routes) will work.
Alternatively, you can update your server to support redirects to have the html mode work.
example server configurations

What do you lose by ejecting a React app that was created using create-react-app?

I'm interested in using Hot Module Replacement with a newly created React app.
Facebook Incubator's create-react-app uses Webpack 2 which can be configured to support HMR, however in order to do so, one needs to "eject" the create-react-app project.
As the documentation points out, this is a "one way" operation and cannot be reversed.
If I'm to do this, I want to know what I might be giving up. I've been unable to locate any documentation that explains the potential drawbacks of ejecting.
The current configuration allows your project to get updates from create-react-app core team. Once you eject you no longer get this.
It's kind of like pulling in bootstrap css via CDN as opposed to downloading the source code and injecting it directly into your project.
If you want more control over your webpack, there are ways to configure/customize it without ejecting:
https://www.npmjs.com/package/custom-react-scripts

merge large existing web app into Sailjs site

I'm trying to merge large existing web app into sails.js. so I moved the folders into assets and build a custom route , 'GET /': '/assets/client/launch.html' and get 404 when I point my browser to http://localhost:1337/ as the / is correctly redirected to http://localhost:1337/assets/client/launch.html which produces the 404.
Now the file exists in the folder assets/client (and in .tmp), so I am thinking the Sails router is getting in the way.
I would leave the client (70K lines of JS) that generates all the UI dynamically and sailjs server that provides authentication separate and enable CORS but my customer wants client packaged with server. This type of operation is simple in frameworks like ASP.NET MVC but am wondering if Sails is up to the task.
Well, If everything you tried did not work out. There might be another solution ,
First of all since you are talking about sails app I am assuming other bundle must be sails as well ,
So here is what you do-
Change the port for another app that you want to attach to this.
Second whenever you want to go to page on another app simply redirect the client to another port ie
in html or esp put a href tag with different port.
<a href="localhost:PORT/route_to_file">
</a>
I got it working by placing my app into assets where we need to launch from assets/client/index.html as there would be too many dependencies to change. As I said above could not just add a route as Sails must getting in the way. However as in Chapter 3.2.2 of Sails in Action I generated a static asset npm install sails-generate-static --save. then I redirected to assets/client/index.html. As an aside that book is great and would highly recommend it.