Simple server side Node.js application (for example API provider with simple Web UI) — is the best usage case of the boilerplate.
- Command line oriented development. No IDE, no framework, just your faivorite code editor and powerful set of tools
- Hot page and resource reloading while code editing in development mode
- Resource bundling and minification with no config for production deployment
- No paths in imports. Just dependency name for vendor libs as well as your modules located in
app/node_modulesfolder for Node’s dependencies resolution algorithm
/app— server side application code folder/app/node_modules- place your server modules here/public— client side html/jpeg/css files and javascript code for your "serverless" application/install— database initialization scripts and other files for server app deployment/bin— server side application start/stop scripts and similar helpers/node_modules— place for third party libs. Will reveille itself afternpm installcommadn execution. You do NOT want to place it under git control :)
git clone https://github.com/app/node.frameworkless.boilerplate.git my-best-app
cd my-best-app
npm i
Start you server app with
npm run dev
Start you static client app with
npm run web
npm run build
will create minified and bundled static app in dist/ direcrory.
You have to copy dist/ where nginx root indicates.
For server application you have to setup systemd service with this example
Some text editors and IDE's have a feature called safe write that basically prevents data loss, by taking a copy of the file and renaming it when saved.
This feature blocks the automatic detection of file updates. To disable safe write use the options provided below:
- Sublime Text 3 add atomic_save: "false" to your user preferences.
- IntelliJ use search in the preferences to find "safe write" and disable it.
- Vim add :set backupcopy=yes to your settings.
- WebStorm uncheck Use "safe write" in Preferences > Appearance & Behavior > System Settings.