8000 FrontEnd 4.4/2: Finished · JayAyAre/PyScript-vs-JavaScript@d14cc90 · GitHub
[go: up one dir, main page]

Skip to content

Commit d14cc90

Browse files
committed
FrontEnd 4.4/2: Finished
1 parent 6928b94 commit d14cc90

File tree

27 files changed

+497
-410
lines changed
  • python
  • version-1
  • src
  • Benchmarks/4.4-manejo-peticiones/prueba-2/json
  • 27 files changed

    +497
    -410
    lines changed

    Astro-TFG/astro.config.mjs

    Lines changed: 8 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,12 +1,15 @@
    11
    // astro.config.mjs
    22
    import { defineConfig } from 'astro/config';
    3+
    import node from '@astrojs/node';
    34
    import tailwindcss from '@tailwindcss/vite';
    45

    56
    export default defineConfig({
    7+
    output: 'server',
    8+
    adapter: node({
    9+
    mode: 'standalone', // <-- aquí le dices cómo comportarse
    10+
    }),
    611
    vite: {
    7-
    server: {
    8-
    cors: true,
    9-
    },
    12+
    server: { cors: true },
    1013
    plugins: [
    1114
    {
    1215
    name: 'astro-dev-add-headers',
    @@ -15,13 +18,12 @@ export default defineConfig({
    1518
    res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
    1619
    res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
    1720
    res.setHeader('Access-Control-Allow-Origin', '*');
    18-
    res.setHeader('Access-Control-Allow-Methods', 'GET');
    21+
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
    1922
    next();
    2023
    });
    2124
    },
    2225
    },
    2326
    tailwindcss(),
    2427
    ],
    2528
    },
    26-
    output: 'server',
    27-
    });
    29+
    });

    Astro-TFG/package.json

    Lines changed: 22 additions & 18 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,20 +1,24 @@
    11
    {
    2-
    "name": "astro-tfg",
    3-
    "type": "module",
    4-
    "version": "0.0.1",
    5-
    "scripts": {
    6-
    "dev": "astro dev",
    7-
    "build": "astro build",
    8-
    "preview": "astro preview",
    9-
    "astro": "astro"
    10-
    },
    11-
    "dependencies": {
    12-
    "@tailwindcss/cli": "^4.1.4",
    13-
    "@tailwindcss/vite": "^4.1.4",
    14-
    "astro": "^5.7.9",
    15-
    "plotly.js-dist-min": "^3.0.1"
    16-
    },
    17-
    "devDependencies": {
    18-
    "tailwindcss": "^4.1.4"
    19-
    }
    2+
    "name": "astro-tfg",
    3+
    "type": "module",
    4+
    "version": "0.0.1",
    5+
    "scripts": {
    6+
    "dev": "concurrently \"astro dev\" \"node server.mjs\"",
    7+
    "build": "astro build",
    8+
    "preview": "astro preview",
    9+
    "astro": "astro"
    10+
    },
    11+
    "dependencies": {
    12+
    "@astrojs/node": "^9.2.1",
    13+
    "@tailwindcss/cli": "^4.1.4",
    14+
    "@tailwindcss/vite": "^4.1.4",
    15+
    "astro": "^5.7.9",
    16+
    "concurrently": "^8.2.2",
    17+
    "plotly.js-dist-min": "^3.0.1",
    18+
    "ws": "^8.18.2"
    19+
    },
    20+
    "devDependencies": {
    21+
    "@types/ws": "^8.18.1",
    22+
    "tailwindcss": "^4.1.4"
    23+
    }
    2024
    }

    Astro-TFG/public/scripts/4.4-manejo-peticiones/prueba-1/version-1/python/main.py

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -54,5 +54,4 @@ def js_run_py_benchmark(event):
    5454
    asyncio.ensure_future(launch_worker(None))
    5555

    5656

    57-
    # Exponemos la función al onclick
    5857
    js.window.run_py_benchmark = js_run_py_benchmark

    Astro-TFG/public/scripts/4.4-manejo-peticiones/prueba-1/version-1/python/worker.py

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,5 +1,4 @@
    1-
    from unittest import result
    2-
    from pyscript import fetch, sync, display
    1+
    from pyscript import fetch, sync
    32
    import asyncio
    43
    import time
    54

    Astro-TFG/public/scripts/4.4-manejo-peticiones/prueba-2/javascript/app.js

    Lines changed: 0 additions & 42 deletions
    This file was deleted.

    Astro-TFG/public/scripts/4.4-manejo-peticiones/prueba-2/javascript/main.js

    Lines changed: 0 additions & 90 deletions
    This file was deleted.

    Astro-TFG/public/scripts/4.4-manejo-peticiones/prueba-2/javascript/worker.js

    Lines changed: 0 additions & 74 deletions
    This file was deleted.

    Astro-TFG/public/scripts/4.4-manejo-peticiones/prueba-2/python/app.py

    Lines changed: 0 additions & 42 deletions
    This file was deleted.

    0 commit comments

    Comments
     (0)
    0