FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Shared is working on both front and back! · lpython/raytrace@62afcd3 · GitHub

Repository navigation

Commit 62afcd3

Browse files
committed
Shared is working on both front and back!
1 parent dc149bb commit 62afcd3

14 files changed

Lines changed: 2442 additions & 316 deletions

‎back/package-lock.json‎

Lines changed: 540 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎back/package.json‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
"scripts": {
66
"build": "tsc",
77
"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",
99
"watch-front": "cpx \"../front/dist/*\" \"./public/\" -w"
1010
},
1111
"keywords": [],
1212
"author": "",
1313
"license": "ISC",
1414
"dependencies": {
15+
"@python36/raytrace": "1.2.0",
16+
"@types/cors": "^2.8.6",
1517
"bmp-js": "^0.1.0",
18+
"cors": "^2.8.5",
1619
"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"
1922
},
2023
"devDependencies": {
2124
"@types/express": "^4.17.1",

‎back/src/index.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
// const express = require('express');
2-
// const path = require('path');
3-
4-
import express from 'express';
51
import path from 'path';
62

3+
import express from 'express';
74
import bmp from 'bmp-js';
85

9-
// import RayTracer from '../lib/raytrace';
10-
// import { defaultScene } from '../lib/scene';
6+
import cors from 'cors';
7+
118

129
import RayTracer, { defaultScene } from '@python36/raytrace';
1310

@@ -22,6 +19,7 @@ const int = (s: string) => {
2219
}
2320

2421
express()
22+
.use(cors())
2523
.use(express.static(path.join(__dirname, '/../', 'public')))
2624
.get('/gen.bmp', (req, res) => {
2725
const width = req.query.width ? Math.max(int(req.query.width),128) : 128;

‎back/tsconfig.tsbuildinfo‎

Lines changed: 349 additions & 113 deletions
Large diffs are not rendered by default.

‎front/dist/app.js‎

Lines changed: 178 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL