mirror of
https://github.com/moudey/Shell.git
synced 2026-11-16 09:04:25 +08:00
Create local web application to display website locally
This commit is contained in:
1 parent
782d480816
commit
ad18b14e09
6 files changed
+469
No files matched your search
@@ -0,0 +1,21 @@
|
||||
<%@ Page Language="VB" AutoEventWireup="false" Codebehind="Default.aspx.vb" CodeFile="Default.aspx.vb" Inherits="_Default" Debug="true" %><%
|
||||
|
||||
Select Case requestType
|
||||
|
||||
Case "document"
|
||||
|
||||
%><!-- #include file = "_page.aspx" --><%
|
||||
|
||||
Case "image"
|
||||
|
||||
includeImage(requestedFile)
|
||||
|
||||
Case Else
|
||||
|
||||
%>
|
||||
Unknown Type <%= requestType %>
|
||||
<%
|
||||
|
||||
End Select
|
||||
|
||||
%>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,89 @@
|
||||
# View documentation on your local machine
|
||||
|
||||
**WARNING: This is not meant to be used on a production sever!!**
|
||||
|
||||
It's sole intention is to be able to see the documentation documents in a context like on the live website in order to
|
||||
be able to see the full formatting. So it's mainly intended for documentation authors or editors.
|
||||
|
||||
## Local web server
|
||||
|
||||
### Get Cassini 4 (tiny, redistributable ASP.NET webserver)
|
||||
|
||||
With PowerShell (no administrative privileges required):
|
||||
|
||||
``` PowerShell
|
||||
# Source URL
|
||||
$url = "https://github.com/adriancs2/CassiniDev/releases/download/5f7df0d/CassiniDev4.zip"
|
||||
|
||||
# Destination file
|
||||
$zip = ".\CassiniDev4.zip"
|
||||
|
||||
# Download the file
|
||||
Invoke-WebRequest -Uri $url -OutFile $zip
|
||||
|
||||
# Unzip the file
|
||||
Expand-Archive -Path $zip -DestinationPath '.\bin\CassiniDev4\'
|
||||
|
||||
# Delete archive
|
||||
Remove-Item $zip
|
||||
|
||||
```
|
||||
|
||||
### Start the web server
|
||||
|
||||
With PowerShell:
|
||||
|
||||
``` PowerShell
|
||||
# Set the port you want to listen on. 80 is the default for http://
|
||||
$port = 80
|
||||
|
||||
# Run the webserver
|
||||
.\bin\CassiniDev4\CassiniDev4.exe /port:$port /path:. /vpath:/ /nodirlist /portMode:Specific
|
||||
|
||||
echo "To see the documentation, open the following url in your browser:"
|
||||
echo "http://localhost:$port/docs"
|
||||
|
||||
```
|
||||
|
||||
With Command Prompt:
|
||||
|
||||
``` Cmd
|
||||
# Set the port you want to listen on. 80 is the default for http://
|
||||
set port = 80
|
||||
|
||||
# Run the webserver
|
||||
.\bin\CassiniDev4\CassiniDev4.exe /port:%port% /path:. /vpath:/ /nodirlist /portMode:Specific
|
||||
|
||||
echo To see the documentation, open the following url in your browser:
|
||||
echo http://localhost:%port%/docs
|
||||
|
||||
```
|
||||
|
||||
### Stop the web server
|
||||
|
||||
In your tray icons section, you will find an icon showing above url as tooltip. Right-clicking on the icon opens a
|
||||
context menu with the following options:
|
||||
|
||||
- Show
|
||||
- Brows
|
||||
- View Log
|
||||
- Exit
|
||||
|
||||
Obviously, choose `Exit` to quit the web server. :-)
|
||||
|
||||
<!--
|
||||
|
||||
## Alternative: UltiDev Web Server Pro
|
||||
|
||||
see: http://ultidev.com/Forums/yaf_postst688_Installation--Operations--Troubleshooting.aspx
|
||||
and: http://ultidev.com/forums/yaf_postsm2939_Debugging-your-web-app-with-UWS--or-just-hosting-the-app-from-command-line.aspx#post2939
|
||||
|
||||
Download:
|
||||
http://ultidev.com/download/RegisterAndDownload.aspx?ProductID=3245eb7e-5b39-4568-8cb9-05e32d4291e7
|
||||
http://download.ultidev.com/Products/Cassini/Pro/Build21/UltiDev%20Web%20Server%20Setup.exe
|
||||
|
||||
```cmd
|
||||
"%ProgramFiles%\UltiDev\Web Server\UWS.InteractiveServer.Clr4AnyCPU.exe" /port:80 /path:C:\Users\mdr\projects\nilesoft.shell\www\root /vdir: /defaultdoc:Default.aspx /dirbrowsing:no /bypass:no /browser:firefox.exe
|
||||
```
|
||||
|
||||
-->
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- @see https://weblogs.asp.net/scottgu/tip-trick-url-rewriting-with-asp-net -->
|
||||
|
||||
<configuration>
|
||||
|
||||
<configSections>
|
||||
<section name="rewriter"
|
||||
requirePermission="false"
|
||||
type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
|
||||
</configSections>
|
||||
|
||||
<system.web>
|
||||
|
||||
<httpModules>
|
||||
<add name="UrlRewriter"
|
||||
type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
|
||||
</httpModules>
|
||||
|
||||
<compilation debug="true"/>
|
||||
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
|
||||
<modules runAllManagedModulesForAllRequests="true">
|
||||
<add name="UrlRewriter"
|
||||
type="Intelligencia.UrlRewriter.RewriterHttpModule"/>
|
||||
</modules>
|
||||
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
|
||||
</system.webServer>
|
||||
|
||||
<rewriter>
|
||||
|
||||
<!-- Do NOT allow access to the /bin/ directory,
|
||||
or anything starting with an underline (_) -->
|
||||
<if url="^/(_.*|.*\.vb$|bin($|/))">
|
||||
<forbidden/>
|
||||
</if>
|
||||
|
||||
<!-- Remove trailing slash -->
|
||||
<redirect url="^(.*)/$" exists="$1" to="$1/" processing="stop"/>
|
||||
<redirect url="^(.*)/$" to="$1" processing="stop"/>
|
||||
|
||||
<rewrite url="^/Default.aspx$" to="/Default.aspx?path=/" processing="stop"/>
|
||||
|
||||
<rewrite url="^(/.*)$" to="/Default.aspx?path=$1" processing="stop"/>
|
||||
|
||||
</rewriter>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<title>Test</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Hello World
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
Reference in new issue
Block a user