4

I have found plenty of questions/aswers about using node.js to build a server and how the javascript (server side) code won't be accessible to people accessing the server via a browser as it is not client side javascript.

If I want to use that server on an iOS or Android device (actually running the server on the device), am I wrong to assume that the server side javascript will now be available to anyone using that device? I don't believe that node.js compiles or otherwise hides the server side javascript.

If what I fear above is true, is there any way keep prying eyes away from the server side javascript on these devices?

Thanks very much for your help.

Dana

danabaillie
  • 75
  • 2
  • 5
  • If want to hide the javacsript from the clients/devices, then why not have them access a Node.js server as you would normally do? Sounds strange to me that you want to put server-side logic on iOS or Android devices. Can you explain what motivates you to do so? – cYrixmorten May 10 '15 at 21:48
  • Hi cYrixmorten, Yes, I can. We currently have a server that was built to present courses in a browser, but do all of the course logic on the server. The server decides what page to display next, what question to display next in assessments, scores assessments and posttests, etc. We now want to be able have someone take our courses on their iOS/Android devices, but also to be able to take them offline. That means having a small version of the server with logic on the device. – danabaillie May 11 '15 at 01:04

2 Answers2

2

As of today, it looks possible (yr 2015).

Check below site, which went open source recently:
http://jxcore.io/

Bernardo Ramos
  • 4,048
  • 30
  • 28
Manohar Reddy Poreddy
  • 25,399
  • 9
  • 157
  • 140
1

You cannot hide node.js javascript files from access on the actual server device. Those files have to be readable to the node interpreter which means they are readable to anyone else. This is basically the same issue as Javascript files used in a browser. The files are visible on the computer in which they are running. Javascript is not a compiled language so the source code is visible.

You could, of course, obscure them (minimize), but that isn't a form of security, just makes it a little more work for someone to see what your code does.

jfriend00
  • 683,504
  • 96
  • 985
  • 979
  • Hi jfriend00, Thanks for confirming my worst fears. It was obvious really, but sometimes it takes asking to make me believe what I don't want to. Dana – danabaillie May 11 '15 at 01:09