Git Product home page Git Product logo

Comments (4)

lukeed avatar lukeed commented on June 21, 2024

What are your wrangler settings? Can DM on Twitter if you don't want to share here.

from worktop.

lukeed avatar lukeed commented on June 21, 2024

We spoke a little bit on Twitter. I cannot reproduce this. Here's my very basic setup:

// src/index.ts
import { Router } from 'worktop';
import * as Cache from 'worktop/cache';

const API = new Router;

API.add('GET', '/about', (req, res) => {
  res.send(200, 'ABOUT');
})

API.add('GET', '/', (req, res) => {
  res.send(200);
})

Cache.listen(API.run);
// package.json
{
  "private": true,
  "name": "worktop123",
  "main": "build/index.js",
  "scripts": {
    "build": "cfw build src --single"
  },
  "devDependencies": {
    "cfw": "0.1.3",
    "typescript": "4.2.4",
    "worktop": "0.5.0"
  }
}
# wrangler.toml
name = "worktop123"
type = "javascript"
workers_dev = true

route = ""
account_id = "<REDACT>"
zone_id = ""

[build]
command = "npm run build"
upload.format = "service-worker"

Currently deployed to https://worktop123.lukeed.workers.dev.

The home page returns a blank page (200 code) because I sent no content.
The about page, for added measure, returns the ABOUT text for a 200 status code.


Closing as invalid/not reproducible, but happy to try again if you have something I can try again.
Although, my hunch is that there's something else going on with your account/routing settings (not sure what) – and isn't code-related.

from worktop.

StarpTech avatar StarpTech commented on June 21, 2024

No idea but it works now.

from worktop.

lukeed avatar lukeed commented on June 21, 2024

Probably networking hiccup on CF side for the new dev domain 🤷

from worktop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.