diff options
author | amelia <[email protected]> | 2022-06-18 21:54:19 -0500 |
---|---|---|
committer | amelia <[email protected]> | 2022-06-18 21:54:19 -0500 |
commit | b7e7dece4b6a85b242bc87ddd005ce12d484f7a5 (patch) | |
tree | 877ad736777de6b0eb9a235f929e9cd03e91d9b3 /server.ts | |
parent | 25c18c481666857a3123e08db0bdc541b6cb88b8 (diff) |
switched to ts, and html updates
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server.ts b/server.ts new file mode 100644 index 0000000..4907371 --- /dev/null +++ b/server.ts @@ -0,0 +1,14 @@ +var fs = require('fs'); +var express = require('express'); +var app = express(); +const PORT = 8008 || process.env.PORT;; +fs.readFile('./index.html', function (err:any, html:any) { +app.listen(PORT, function () { + console.log('listening! http://localhost:' + PORT); +}); +app.get('/', function (req:any, res:any) { + res.sendFile('index.html', {root: __dirname }) +}) +app.get('/crates.json', function (req:any, res:any) { + res.sendFile('crates.json', {root: __dirname }) +})})
\ No newline at end of file |