Check if is deployed as web app

11 visualizaciones (últimos 30 días)
Julian Schmid
Julian Schmid el 25 de Ag. de 2020
Respondida: Christian Svensson el 30 de Sept. de 2022
Hi,
since the web apps come with some limitations, it might be usefull to determine whether the deployed app is a web app or a standalone app. Is there a way to find out what kind of deployment "mode" is running? The deployed function only returns true or false.
Thanks!
Julian

Respuestas (2)

Mohammad Sami
Mohammad Sami el 25 de Ag. de 2020
Editada: Mohammad Sami el 25 de Ag. de 2020
As far as i am aware there are no function to check if a deployed app is a webapp.
A workaround as follows may work. Add a an empty file to the compiled webapp under Files Required for your app to run.
Example if you add a file "this.isawebapp". You can then check for the existence of this file in a function
function out = isawebapp()
if isdeployed
%out = exist(fullfile(ctfroot,'this.isawebapp'),'file') == 2;
out = ~isempty(which('this.isawebapp'));
else
out = false;
end
end

Christian Svensson
Christian Svensson el 30 de Sept. de 2022
There is an built in function that checks if the app is an web app. As always, be careful when using undocumented internal functions.
matlab.internal.environment.context.isWebAppServer

Categorías

Más información sobre MATLAB Web App Server en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by