Skip to content

Commit d6298de

Browse files
committed
azure compatibility-ish
1 parent 57ac949 commit d6298de

5 files changed

Lines changed: 70 additions & 6 deletions

File tree

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"serve": "nodemon --watch ./ --watch ./views -e js,twig server.js",
99
"serveprod": "NODE_ENV=production nodemon --watch ./ --watch ./views -e js,twig server.js",
10-
"start": "NODE_ENV=production node server.js"
10+
"start": "node server.js"
1111
},
1212
"author": "JP de Vries",
1313
"license": "UNLICENSED",
1414
"engines": {
1515
"node": "6.3.0"
1616
},
17+
"optionalDependencies": {
18+
"windows-build-tools": "*"
19+
},
1720
"devDependencies": {
1821
"autoprefixer": "^6.4.0",
1922
"babel-preset-es2015": "^6.14.0",
@@ -48,7 +51,7 @@
4851
"formidable": "^1.0.17",
4952
"hex-and-rgba": "^1.1.0",
5053
"install": "^0.8.1",
51-
"lwip": "0.0.9",
54+
"node-lwip": "^0.2.1",
5255
"npm": "^3.10.6",
5356
"onecolor": "^3.0.4",
5457
"png-coder": "^0.2.1",

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ path = require('path'),
1919
app = express();
2020

2121
//PNG = require('png-coder').PNG;
22-
const redirects = require('./_build/js/redirects'),
22+
const redirects = require('./_build/js/redirects'),
2323
util = require('util'),
2424
svg2png = require('svg2png'),
2525
toIco = require('to-ico'),
2626
tmpDir = './temp',
2727
PNGPixel = require('png-pixel'),
28-
lwip = require('lwip'),
28+
lwip = require('node-lwip'),
2929
PNG = require('pngjs').PNG,
3030
transparent = {r: 255, g: 255, b: 255, a: 0},
3131
hexToRgba = require('hex-and-rgba').hexToRgba,

serviceWorker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var CACHE_NAME = 'rc0.0.9.15';
3+
var CACHE_NAME = '1.0.0-pl';
44
//cacheAll = true;
55

66
self.addEventListener('install', function(event) {

serviceWorker.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web.config

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
This configuration file is required if iisnode is used to run node processes behind
4+
IIS or IIS Express. For more information, visit:
5+
6+
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
7+
-->
8+
9+
<configuration>
10+
<system.webServer>
11+
<!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
12+
<webSocket enabled="false" />
13+
<handlers>
14+
<!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
15+
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
16+
</handlers>
17+
<rewrite>
18+
<rules>
19+
<!-- Do not interfere with requests for node-inspector debugging -->
20+
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
21+
<match url="^server.js\/debug[\/]?" />
22+
</rule>
23+
24+
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
25+
<rule name="StaticContent">
26+
<action type="Rewrite" url="public{REQUEST_URI}"/>
27+
</rule>
28+
29+
<!-- All other URLs are mapped to the node.js site entry point -->
30+
<rule name="DynamicContent">
31+
<conditions>
32+
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
33+
</conditions>
34+
<action type="Rewrite" url="server.js"/>
35+
</rule>
36+
</rules>
37+
</rewrite>
38+
39+
<!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
40+
<security>
41+
<requestFiltering>
42+
<hiddenSegments>
43+
<remove segment="bin"/>
44+
</hiddenSegments>
45+
</requestFiltering>
46+
</security>
47+
48+
<!-- Make sure error responses are left untouched -->
49+
<httpErrors existingResponse="PassThrough" />
50+
51+
<!--
52+
You can control how Node is hosted within IIS using the following options:
53+
* watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
54+
* node_env: will be propagated to node as NODE_ENV environment variable
55+
* debuggingEnabled - controls whether the built-in debugger is enabled
56+
57+
See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
58+
-->
59+
<iisnode node_env="production"/>
60+
</system.webServer>
61+
</configuration>

0 commit comments

Comments
 (0)