|
| 1 | +/* |
| 2 | +
|
| 3 | +Online Python Tutor |
| 4 | +https://github.com/pgbovine/OnlinePythonTutor/ |
| 5 | +
|
| 6 | +Copyright (C) Philip J. Guo (philip@pgbovine.net) |
| 7 | +
|
| 8 | +Permission is hereby granted, free of charge, to any person obtaining a |
| 9 | +copy of this software and associated documentation files (the |
| 10 | +"Software"), to deal in the Software without restriction, including |
| 11 | +without limitation the rights to use, copy, modify, merge, publish, |
| 12 | +distribute, sublicense, and/or sell copies of the Software, and to |
| 13 | +permit persons to whom the Software is furnished to do so, subject to |
| 14 | +the following conditions: |
| 15 | +
|
| 16 | +The above copyright notice and this permission notice shall be included |
| 17 | +in all copies or substantial portions of the Software. |
| 18 | +
|
| 19 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 20 | +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 21 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 22 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 23 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 24 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 25 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 26 | +
|
| 27 | +*/ |
| 28 | + |
| 29 | +// This is a nodejs server based on express that serves the v4-cokapi/ app |
| 30 | +// To test locally, run 'make' and load http://localhost:3000/ |
| 31 | + |
| 32 | + |
| 33 | +var express = require('express'); |
| 34 | +var app = express(); |
| 35 | + |
| 36 | +app.get('/', function(req, res) { |
| 37 | + res.send('Hello World!'); |
| 38 | +}); |
| 39 | + |
| 40 | +var server = app.listen(3000, function() { |
| 41 | + var host = server.address().address; |
| 42 | + var port = server.address().port; |
| 43 | + console.log('Example app listening at http://%s:%s', host, port); |
| 44 | +}); |
0 commit comments