I am use to working with MVC and previously Web Forms of asp.net so with those View Engines to Server ... I never had to worry about when I worked with visual studio on local computer to publishing the website to servers.
However, the way I started building websites is with HTML5 calling up Web Api
Basically so that I can easily work locally and promote the code i end up doing this "hack" is there a better way?
As you see if not detecting localhost i have it add in DOCCCO
Its a Web Api project in which I use plan HTML files with jquery ajax calls ..
locally it renders to localhost:455434/whatever.html
server then is servername/DOCCCO/whatever.html
Thus the SERVERNAME is = localhost:port , but the project name is getting injected / appended as it has to on the server as there are many projects.
So what are my options with more barebones HTML5 ?
1. fix localhost:port to always have localhost:port/DOCCCO , how?
2. fix web api Webapiconfig.cs or routeconfig.cs ???
<script>
if (document.location.hostname === "localhost") {
document.write('<script src="/Scripts/jquery-2.1.4.min.js"><\/script>');
document.write('<script src="/Scripts/jquery.tablesorter.min.js"><\/script>');
document.write('<script src="/Scripts/app.js"/><\/script>');
document.write('<script src="/Scripts/flexdropdown.js"/><\/script>');
}
else {
document.write('<script src="/DOCCCO/Scripts/jquery-2.1.4.min.js"><\/script>');
document.write('<script src="/DOCCCO/Scripts/jquery.tablesorter.min.js"><\/script>');
document.write('<script src="/DOCCCO/Scripts/app.js"><\/script>');
document.write('<script src="/DOCCCO/Scripts/flexdropdown.js"/><\/script>');
}
</script>