Giter Club home page Giter Club logo

Comments (4)

rbren avatar rbren commented on July 1, 2024

This is a great idea. It would only take a bit of refactoring in ./src/lib/project-server.js to return an express router rather than starting a server. I'm thinking something like:

var datafire = require('datafire');
var project = datafire.Project.fromDirectory(__dirname);
var app = require('express')();

app.use('/api', project.router())
app.listen(3000);

I'm happy to take a crack at this tomorrow, but if you're eager feel free to submit a PR.

from datafire.

coderofsalvation avatar coderofsalvation commented on July 1, 2024

hm yes i like that idea.
That would make it very modular & extendable.
Unfortunately I'll be busy this week to deliver a nodejs project to a client.
I just looked at the code, and i wasn't really sure what to do with the close()-function.
Keep in touch!

from datafire.

rbren avatar rbren commented on July 1, 2024

Just published this feature in 2.3.0. Here's the docs:

https://github.com/DataFire/DataFire/blob/master/docs/Cookbook.md#nodejs-express

from datafire.

coderofsalvation avatar coderofsalvation commented on July 1, 2024

awesome thx! i will play with it asap (still have a deadline this werk, but can't wait to try it out)

from datafire.

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.