Giter Site home page Giter Site logo

Comments (5)

mlesswing avatar mlesswing commented on August 16, 2024

Each platform needs to have the Javascript version of the library compiled for it, so making a generic NPM will be tricky as you have found out.

I also have a Node.js project that uses libRETS. I will be sharing soon to translate RESO Web API requests into RETS calls. I used libRETS to do the RETS part. You will be able to "hack" this to answer your question. Unfortunately, I am still a few weeks away from release. How can I help you in the meantime? I put librettos.node in a [root]/lib directory and call it like this (but you probably know how it works):

var librets = require(__dirname + '/../lib/librets.node');

var session = new librets.RetsSession( {RETS_SERVER_LOGIN_URL} );
session.SetRetsVersion(librets.RETS_1_8_0);
if (!session.Login( {NAME}, {PASSWORD} )) {
var request = session.CreateSearchRequest( {TYPE}, {CLASS}, {FILTER} );
request.SetStandardNames(true);
request.SetSelect(req.query.$select);
request.SetLimit(librets.SearchRequest.LIMIT_DEFAULT);
request.SetOffset(librets.SearchRequest.OFFSET_NONE);
request.SetCountType(librets.SearchRequest.RECORD_COUNT_AND_RESULTS);
request.SetFormatType(librets.SearchRequest.COMPACT);
var results = session.Search(request);
}

Mark Lesswing
[email protected]

On Feb 4, 2016, at 12:06 PM, Brian Riviere [email protected] wrote:

Would anyone be able to give me suggestion on how to a create npm module so I can use in in my nodejs application?

thanks

Brian


Reply to this email directly or view it on GitHub.

from librets.

briviere avatar briviere commented on August 16, 2024

Right now my next challenge is getting it to work on Heroku. It appears that I will have to create a custom build package https://devcenter.heroku.com/articles/buildpacks#officially-supported-buildpacks unless there is one already created?

Brian

from librets.

briviere avatar briviere commented on August 16, 2024

So I'm trying to get libRets working on the Heroku.

I have install boost 1.54 buildpack and nodejs build packs:

heroku buildpacks
=== therightrealty Buildpack URLs

  1. heroku/nodejs
  2. https://github.com/briviere/heroku-buildpack-boost.git

The boost libs appear to installed but I keep getting an error message saying it cant find the following boost 1.54.0 file:

2016-02-19T21:42:41.671472+00:00 app[web.1]: Error: libboost_filesystem.so.1.54.0: cannot open shared object file: No such file or directory

I'm not exactly sure if boost is install correctly, the ls command does return a list of boost files:

heroku run ls /usr/lib/x86_64-linux-gnu/libboos_.so_1.54*

Running ls /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_prg_exec_monitor.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_python-py34.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0 /usr/lib/x86_64-linux-gnu/libboost_wserialization.so.1.54.0 on therightrealty... up, run.1922
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_prg_exec_monitor.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_python-py34.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0: No such file or directory
ls: cannot access /usr/lib/x86_64-linux-gnu/libboost_wserialization.so.1.54.0: No such file or directory

from librets.

jazzklein avatar jazzklein commented on August 16, 2024

That says that the files don't exist, or you don't have the permission to access them.

from librets.

briviere avatar briviere commented on August 16, 2024

I was finally able to get libRets node.js module working on a Heroku dyno. I had to do the following to get libBoost installed correctly.

  1. Add the following buildpack to you heroku project:

heroku buildpacks:add https://github.com/heroku/heroku-buildpack-apt --index 1

  1. Create an Aptfile in your project base directory with the following:

libstdc++-4.8-dev
libboost1.42-dev
libboost1.46-dev
libboost1.48-dev
libboost1.49-dev
libboost1.50-dev
libboost1.52-dev
libboost1.53-dev
libboost-atomic1.54-dev
libboost-chrono1.54-dev
libboost-context1.54-dev
libboost-coroutine.54-dev
libboost-date-time1.54-dev
libboost-exception1.54-dev
libboost-filesystem1.54-dev
libboost-graph-parallel1.54-dev
libboost-graph1.54-dev
libboost-iostreams1.54-dev
libboost-locale1.54-dev
libboost-log.54-dev
libboost-math1.54-dev
libboost-mpi-python1.54-dev
libboost-mpi1.54-dev
libboost-program-options1.54-dev
libboost-python1.54-dev
libboost-random1.54-dev
libboost-regex1.54-dev
libboost-serialization1.54-dev
libboost-signals1.54-dev
libboost-system1.54-dev
libboost-test1.54-dev
libboost-thread1.54-dev
libboost-timer1.54-dev
libboost-wave1.54-dev
libboost1.54-doc
libboost1.54-tools-dev
libmpfrc++-dev
libntl-dev

  1. Create a .buildpacks and include your additional buildpacks. I only have one I needed to include:

    https://github.com/heroku/heroku-buildpack-nodejs

  2. commit and push.

Brian

from librets.

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.