This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
camperking's profile picture

ccwebedit - web based code editor (node.js)

Started by camperking, 19 January 2013 - 07:41 AM
camperking #1
Posted 19 January 2013 - 08:41 AM
Hello community,

I have build a web based code editor for computercraft programs. It uses node.js and no other dependencies and has only ~100 lines of code. The webpage uses the ace editor for comfortable programming and syntax highlightening. (behind the link are also examples of how the editor looks like)

Usage:
At the beginning of the program you must specify a variable pathhome it will read and show to users
At the end of the file you can specify the port it will listen to (server.listen(8080); )
On /list the server responds recursively a list of all files and dirs. the folder it will output is set with the variable pathhome. When you click on a file the editor opens and you can edit the program.
At top you see the path and filename. You can change the path and filename, so you can make copies of what you edit, but the path must exist before. It will not create any folders.
If you click save there is for now no notification but if you look ingame on your computer or floppydisk the changes should be there.
on / there is nothing implemented yet, but it is working :D/>

We are running this on a private secured server. If someone has your ip and port it could be potentially dangerous to run this program on your server. Everyone can see and edit your computercraft programs.

This is a very basic program. It has nothing more than a file listing and a working editor with asynchronous saving. I've planned for the next versions to add a better user interface and maybe a better file listing. But besides that you are free to fork and edit on github.

https://github.com/c...rking/ccwebedit

Please tell me what you think, I am very happy on some feedback. Thanks

cya camperking
draeath #2
Posted 26 January 2013 - 05:28 AM
Neat idea. Not familiar with the method you are opening a server - is it possible to have any form of authentication? Or would I need to set up a proxy via Apache and keep the actual port behind the firewall?