Giter VIP home page Giter VIP logo

cppwebify-tutorial's Introduction

Getting your C++ to the Web with Node.js

This repository is the code for a blog series I wrote here. It's designed to outline a few ways to take legacy C++ (or new C++) and integrate it with Node.js.

Build instructions

First... get the code:

> git clone https://github.com/freezer333/cppwebify-tutorial.git

Step 1: Install node-gyp

This is required for building all the C++ example projects, including the addons.

> npm install -g node-gyp

Step 2: Install grunt CLI (optional)

You can build all the projects from the CLI if you use grunt. If you don't want to install grunt, you can build all the projects individually (see step 3) instead.

> npm install -g grunt-cli

Step 3: Build the examples

This tutorial includes 6 seperate C++ projects and one web (express) project. You'll only run the web app, but you need to build all the C++ apps. I've included a grunt script to take care of the entire build process (which is explained in the tutorial).

If you have grunt installed

Go into the /web directory and to build everything just type:

> npm install        

which installs the web and grunt build dependencies... and then

> grunt              

which build the C++ examples. If you want to remove the build artifacts (clean), just type:

> grunt cleanup

If you don't want to use grunt

You need to got into each directory under /cpp that has a binding.gyp file - which are the following:

/cpp/lib4ffi
/cpp/nodeprime  
/cpp/nodeprime_sync  
/cpp/standalone_flex_file
/cpp/standalone_stdio
/cpp/standalone_usr

And type npm install inside each directory.

To run the web app, go to /web and type npm install as well.

Run the web app

The web app has links to invoke all the C++ examples. Just go to /web and type:

> node index

cppwebify-tutorial's People

Contributors

freezer333 avatar zorbing avatar

Watchers

 avatar

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.