Product
Introducing Java Support in Socket
We're excited to announce that Socket now supports the Java programming language.
generator-nodeserver
Advanced tools
This generator produces an Express-based Node.js server project with all the ingredients you need for a good start at building a cloud native application. You can choose between either a simple web app or microservice pattern. Combine the microservice pattern with a web app for a backend-for-frontend pattern.
Bring your own optional Swagger document to direct code generation for top-down development.
The generated projects are pre-wired for monitoring and health checks. The app includes
The generated projects include deployment configuration for the following environments:
Docker
The projects include Docker files to build images for both release and development
Kubernetes
The projects include a Helm chart for deployment to Kubernetes.
Cloud Foundry
The projects include a manifest for deployment to Cloud Foundry.
Dev-ops Pipeline
The projects include a toolchain and pipeline definition for CI/CD deployment to the IBM Cloud.
The projects include NPM scripts to install and run IBM Cloud Developer Tools.
Install Yeoman
npm install -g yo
npm install -g generator-nodeserver
yo nodeserver
When you run 'yo nodeserver', it will prompt you for the following:
project name
Specify the project name. It defaults to the current directory name. This is a required value.
Swagger doc file name
Specify the relative or absolute file name of a Swagger document to direct the project's code generation. A route stub will be scaffolded and registered for each route defined in the swagger document. This is an optional value.
IBM Cloud Service Enablement.
Specify Y|N whether or not you want to scaffold IBM Cloud service enablement into your project. If you specify 'Y', you will be able to select one or more services from a checklist. For each service you select,configuration and access scaffolding code is generated. IBM Cloud service enablement is optional.
Build your generated project one of two ways:
normal npm install, npm start
containerized, using IBM Cloud Developer Tools
Note that a containerized approach is supported through the tooling in special consideration of Kubernetes as a deployment environment, following the dev/prod parity principle of 12 Factor Apps.
There are npm scripts to simply this for you:
npm run idt:install
Installs IBM Cloud Developer Tools.
npm run idt:build
Builds Docker image for dev mode and does npm install, including dev dependencies.
npm run idt:test
Runs project unit tests in dev mode Docker container.
npm run idt:debug
Runs the project in debug mode in the dev mode Docker container. The app will start and listen on port 5858 by default for a debug client to attach and take control.
npm run idt:run
Runs the project in the release mode Docker container. The release mode Docker container is built without dev dependencies - i.e. with NODE_ENV set to production.
Build a Docker image and run project in a Docker container using Docker commands in the project root directory:
Stop and optionally remove the container and image with the following commands:
Deploy to Kubernetes using Helm or the IBM Cloud Developer Tools.
Helm
Push your image to a Docker image accessible to your Kubernetes environment, such as Docker Hub or your company's private image registry.
Install your project by installing the included Helm chart, using Helm in the project root directory:
helm install chart/<project name>
--name=<release name>
--set repository=<image name>
--set tag=<tag value>
--set pullPolicy=<pull policy>
Where:
<project name>
The name you gave to your project when you generated it.
<release name>
An arbitrary name you give to this install instance.
<image name>
The registry/image name of your release Docker image - e.g. 'registry.ng.bluemix.net/myspace/myimage'
<tag value>
The image tag value of your release Dockerimage - e.g. 'latest' or '1.0.0'
<pull policy>
'Always' or 'IfNotPresent'. See Kubernetes image documentation for further explanation.
Notes:
The helm command installs to the Kubernetes environment pointed to by the KUBECONFIG environment variable.
The Helm command is installed when you install the IBM Cloud Developer Tools, which you can install for your project by running 'npm run idt:install'
IBM Cloud Developer Tools
npm idt:deploy --target container
Notes:
The idt tool will prompt for registry/image name, then push your image and install your Helm chart to the Kubernetes environment pointed to by your KUBECONFIG environment variable.
For IBM Cloud, set KUBECONFIG using the 'bx cs cluster-config <cluster name>
command. Note this command is installed as part of IBM Cloud Developer Tools, which you can install for your project by running 'npm run idt:install'
cf push
Note: if you installed IBM Cloud Developer Tools using the 'npm run idt:install' command, you can run the 'bx cf push' command. Otherwise, install the cf command from Pivotal.
IBM Cloud Developer Tools
npm idt:deploy
This was installed using your project's 'npm run idt:install' script.
Clone this repository and link it via npm
git clone https://github.com/ibm-developer/generator-nodeserver
cd generator-nodeserver
npm link
In a separate directory invoke the generator via
yo nodeserver
In order to publish changes, you will need to fork the repository or ask to join the ibm-developer
org and branch off the development branch.
Once you are finished with your changes, run npm test
to make sure all tests pass.
Do a pull request against development
, make sure the build passes. A team member will review and merge your pull request.
Once merged to development, the version will be auto-incremented.
Do a pull request against master, once that PR is reviewed and merged, a new version will be published to npm.
FAQs
Generates a nodeserver project.
The npm package generator-nodeserver receives a total of 0 weekly downloads. As such, generator-nodeserver popularity was classified as not popular.
We found that generator-nodeserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.
Security News
Deno 2.0 is now available with enhanced package management, full Node.js and npm compatibility, improved performance, and support for major JavaScript frameworks.