
* autoResize : false, // resizes in response to html content * url : ' // serve static file root and routers For ease of use, here is what my app.js file looks like: var app = module.exports = require( 'appjs') Īpp.serveFilesFrom(_dirname + '/content') Once those two changes are made, your app is set up to use custom chrome. To enable this in the window, set or add the alpha option inside of app.createWindow to true. Next, we need the web browser’s standard background to be transparent and hidden away (otherwise you’ll just get a white window with no transparency).

For custom chrome, the system default window chrome needs to be hidden, so in the window variable, inside the call to app.createWindow, change showChrome to false (or add it if needed… it’s just a standard JavaScript object). /data/content/style.css – Your app’s main stylesheet.Īs mentioned above, the app.js file controls the initial window for your app, and since we want custom chrome, some options will need to be changed.We will be editing this file to create our custom chrome and application content. /data/content/index.html – This is the content for your initial AppJS window.You can create subdirectories to organize your content as you see fit. /data/content Directory – This is where your app’s main content will live.You can set options for your initial window in this file. It is responsible for the connection to node.js and the native operating system. data/app.js – This is the main JavaScript file for the application.Double click it to start node and your app with its initial window. app.exe (for Windows, not sure of the naming on other OSes, but it should be similar) – This is the launcher for your app.The main files associated with an app in the distributable package are: I am using a local web server to test my app in the browser as well as in AppJS, so I’ve extracted mine to the home directory for the web server.

#Appjs compile app zip file
Once the download is complete, extract the ZIP file to a location of your choosing. Visit the AppJS website and choose the correct version of the distributable for your operating system. I’m also not attempting to compile and package a completed app just yet, so I will be using the distributable version and replacing the content files throughout this tutorial. AppJS, on the other hand, uses the Chromium Embedded Framework which renders content beautifully, is super fast and has all of the latest and greatest features HTML5 has to offer without awkward workarounds.īefore getting started, it is worth mentioning that AppJS is still a relatively new project and documentation is sparse at the moment, but it is being worked on. Of course, I’ve also been using Adobe AIR since it was introduced, though AIR for HTML isn’t all that great in my experience. It allows development for the desktop for all three major desktop operating systems using the mix of technologies commonly known as HTML5 and node.js. Over the past few months, I’ve been studying up and trying out several cross-platform development solutions and one of the more interesting ones I’ve found, as a web designer and developer, is AppJS. Also, despite the legacy name, node-webkit uses Chromium as its base, so it is now using the Blink rendering engine. I’ll write a new tutorial for node-webkit sometime in the future. For a similar platform, check out node-webkit which is backed by Intel Open Source and is consistently being improved and updated. If you skipped the Introduction, we strongly recommend reading it before moving on to the rest of the documentation.AppJS is no longer being updated or maintained.
#Appjs compile app install
If you are using VSCode, you can install the es6-string-html extension and prefix the strings with a /*html*/ comment to get syntax highlighting for them. You may have noticed that the imported component's template is inlined as a JavaScript string. You can also use any other HTTP server that can serve static files with the correct MIME types. To start a local HTTP server, first make sure you have Node.js installed, then run npx serve from the command line in the same directory where your HTML file is. In order for ES modules to work on our local machine, we need to serve the index.html over the protocol, with a local HTTP server. If you directly open the above index.html in your browser, you will find that it throws an error because ES modules cannot work over the file:// protocol, which is the protocol the browser uses when you open a local file.ĭue to security reasons, ES modules can only work over the protocol, which is what the browsers use when opening pages on the web.
