Code Monkey home page Code Monkey logo

Comments (2)

nwinter avatar nwinter commented on July 20, 2024

@sderickson Since @smoratinos reorganized everything, do you still want to keep this open? I guess migrating to Koa would be cool, but we should probably do that soon if we're going to, or it's going to keep getting harder.

I would be uncomfortable switching to Restify, because we're going to want something that's going to be well-supported and around for a while.

from codecombat.

sderickson avatar sderickson commented on July 20, 2024

Yes, there's still some reorganization to do. I think we can forget about replacing Express with something else unless someone really wants to do that as a personal project. But there are still a couple major things that really bother me about the current server setup:

  • There's no good way to see what the actual routes available are. This is because some of it's in Handler subclass logic, and the db.coffee file tries to do a bunch of magic with path inspection.
  • The logic for routes and data need to be separated. That is, it's kind of set up right now as if everything that starts with /db/ is in the collection, but that may not be the case because of 'getByRelationship'.

Then the major steps to do are:

  • Refactoring of Handler to put data-related logic into the Models (like formatEntity, or getEditableProperties).
  • Create a routes file which defines all the urls and parameters, using the Router middleware in express.

Really, I'd need to spend some time poring over the express documentation and probably going over some examples of express server implementations to figure out a nicer, more logical structure, but this is what I'm thinking right now. The way it is now is still kind of wonky and unintuitive, I think.

from codecombat.

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.