| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,17 +5,20 @@ | |||
| 5 | 5 | "scripts": { | |
| 6 | 6 | "build": "tsc", | |
| 7 | 7 | "start": "node lib/index.js", | |
| 8 | - "dev-not-working": "ts-node-dev --respawn --transpileOnly src/server.ts", | ||
| 8 | + "dev": "ts-node-dev --respawn --transpileOnly src/server.ts", | ||
| 9 | 9 | "watch-front": "cpx \"../front/dist/*\" \"./public/\" -w" | |
| 10 | 10 | }, | |
| 11 | 11 | "keywords": [], | |
| 12 | 12 | "author": "", | |
| 13 | 13 | "license": "ISC", | |
| 14 | 14 | "dependencies": { | |
| 15 | + "@python36/raytrace": "1.2.0", | ||
| 16 | + "@types/cors": "^2.8.6", | ||
| 15 | 17 | "bmp-js": "^0.1.0", | |
| 18 | + "cors": "^2.8.5", | ||
| 16 | 19 | "express": "^4.17.1", | |
| 17 | - "typescript": "^3.5.1", | ||
| 18 | - "@python36/raytrace": "1.2.0" | ||
| 20 | + "ts-node-dev": "^1.0.0-pre.42", | ||
| 21 | + "typescript": "^3.5.1" | ||
| 19 | 22 | }, | |
| 20 | 23 | "devDependencies": { | |
| 21 | 24 | "@types/express": "^4.17.1", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,10 @@ | |||
| 1 | - // const express = require('express'); | ||
| 2 | - // const path = require('path'); | ||
| 3 | - | ||
| 4 | - import express from 'express'; | ||
| 5 | 1 | import path from 'path'; | |
| 6 | 2 | ||
| 3 | + import express from 'express'; | ||
| 7 | 4 | import bmp from 'bmp-js'; | |
| 8 | 5 | ||
| 9 | - // import RayTracer from '../lib/raytrace'; | ||
| 10 | - // import { defaultScene } from '../lib/scene'; | ||
| 6 | + import cors from 'cors'; | ||
| 7 | + | ||
| 11 | 8 | ||
| 12 | 9 | import RayTracer, { defaultScene } from '@python36/raytrace'; | |
| 13 | 10 | ||
@@ -22,6 +19,7 @@ const int = (s: string) => { | |||
| 22 | 19 | } | |
| 23 | 20 | ||
| 24 | 21 | express() | |
| 22 | + .use(cors()) | ||
| 25 | 23 | .use(express.static(path.join(__dirname, '/../', 'public'))) | |
| 26 | 24 | .get('/gen.bmp', (req, res) => { | |
| 27 | 25 | const width = req.query.width ? Math.max(int(req.query.width),128) : 128; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments