Skip to content

Commit ad34969

Browse files
examples: Update webserver example
Updated readme and minor cleanup in the Dockerfile
1 parent e70ffce commit ad34969

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

examples/webserver/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ COPY site /webserver/site
1111
WORKDIR /webserver
1212

1313
# Compile the webserver into a novus excutable file (.nx).
14-
RUN novc main.ns --out server.nx
14+
RUN novc main.ns -o server.nx
1515

1616
# Open port '80'
1717
EXPOSE 80
1818

1919
# At entry start the webserver on port '80'.
20-
ENTRYPOINT ["novrt", "server.nx", "--port", "80"]
20+
ENTRYPOINT ["./server.nx", "--port", "80"]

examples/webserver/site/readme.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,25 @@ <h2 id="building">Building</h2>
338338
<p>Build output can be found in the <code>bin</code> directory.
339339
For more convenience you can add the <code>bin</code> directory to your <code>PATH</code>.</p>
340340
<h2 id="building-novus-source-code">Building novus source code</h2>
341-
<p>Novus source (<code>.ns</code>) can be compiled into novus executable (<code>.nx</code>) using the
342-
<code>novc</code> executable.</p>
341+
<p>Novus source (<code>.ns</code>) can be compiled into an novus executable (<code>.nx</code>) using the
342+
<code>novc</code> compiler.</p>
343343
<p>Example: <code>./bin/novc examples/fizzbuzz.ns</code>. The output can be found at
344344
<code>examples/fizzbuzz.nx</code>.</p>
345-
<h2 id="running-novus-executable">Running novus executable</h2>
345+
<h2 id="running-novus-an-executable">Running novus an executable</h2>
346346
<p>An Novus executable (<code>.nx</code>) can be run in the novus runtime (<code>novrt</code>).</p>
347347
<p>Example: <code>./bin/novrt examples/fizzbuzz.nx</code>.</p>
348-
<p>On unix if you add the runtime to your <code>PATH</code> you can straight up run <code>.nx</code> files:</p>
349-
<pre><code>chmod +x examples/fizzbuzz<span class="hljs-selector-class">.nx</span>
350-
examples/fizzbuzz.nx
348+
<p>For more convenience you can also run <code>.nx</code> files without specifying the runtime:</p>
349+
<h3 id="unix">Unix</h3>
350+
<p>On unix this can be achieved by adding the runtime to your <code>PATH</code>.</p>
351+
<h3 id="windows">Windows</h3>
352+
<p>On Windows you will have to install file associations using <code>./bin/novrt --install</code> or run
353+
the <code>./bin/novus-install.bat</code> batch script.</p>
354+
<p>That way windows knows to open <code>.nx</code> files with the <code>novrt.exe</code>
355+
executable. To uninstall the associations run <code>./bin/novrt --uninstall</code> or the
356+
<code>./bin/novus-uninstall.bat</code> batch script.
357+
</p>
358+
<p>In either case the result is that you can directly run novus executables:</p>
359+
<pre><code>./fizzbuzz.nx
351360
</code></pre>
352361
<h2 id="evaluator">Evaluator</h2>
353362
<p>Alternatively you can use the <code>nove</code> (novus evaluator) to combine the compilation and running.</p>

0 commit comments

Comments
 (0)