Product
Introducing Java Support in Socket
We're excited to announce that Socket now supports the Java programming language.
generator-swiftserver
Advanced tools
This module is a Yeoman generator for creating REST webservices based on the Kitura web framework with the Swift language.
This generator and the Yeoman library runs on Node.js and generates a Swift 5.0 application.
To use this module, you will need Node.js and Swift 5.0 installed on your Linux or macOS system. You can get Node.js from https://nodejs.org and Swift 5.0 from https://swift.org/download.
You will also need the Yeoman command line utility yo installed in your global Node.js module directory.
To install yo
, run:
npm install -g yo
To install generator-swiftserver, run:
npm install -g generator-swiftserver
To create a Swift Server Generator project with no models defined, run:
yo swiftserver
To add a data model to your generated project, cd
to the new project directory and run:
yo swiftserver:<model>
For more information on data models, check out this guide on Kitura.io.
You can also change how generator-swiftserver is invoked by choosing options:
yo swiftserver [options]
Option | Type | Description |
---|---|---|
--init | n/a | Generate basic default scaffold without prompting user for input. |
--skip-build | n/a | Skip building the generated application |
--single-shot | n/a | Creates application without including generator metadata files |
--bluemix | Json | Invoke generator-swiftserver using a bluemix json object |
--name | String | Project name |
--type | String | Give a specific type of application to generate. (web , bff , scaffold , crud ) |
--metrics | Boolean | Generate embedded metrics dashboard for project |
--docker | Boolean | Generate Dockerfile for project |
--healthcheck | Boolean | Add health checking to project |
--openapi | Boolean | Add Kitura-OpenAPI to project |
--spec | Json | Invoke generator-swiftserver using a spec json object |
To run the generated server, use: <project-dir>/.build/debug/<app-name>
File | Purpose |
---|---|
Dockerfile | Configuration file for the run container |
Dockerfile-tools | Configuration file for the tools container |
LICENSE | License for generated project |
Package.resolved | Results of dependency resolution from Swift Package Manager |
Package.swift | Swift file containing dependencies and targets for project |
README.md | Instructions for building, running, and deploying the project |
Sources/* | Folder containing project source files |
Tests/* | Folder containing project test files |
chart/* | Folder containing Kubernetes Helm Chart files for project |
cli-config.yml | Yaml file containing mappings for various commands, files, and settings, utilized by the cli commands |
manifest.yml | Yaml file containing various information for deployment to IBM Cloud |
spec.json | JSON file containing information about the project, used to generate the project |
myProjectName.xcodeproj | Generated xcodeproj for project |
To get started with development, simply clone this repository and link it via npm:
git clone https://github.com/IBM-Swift/generator-swiftserver
cd generator-swiftserver
npm link
To run the unit tests, run:
npm test
To contribute, you will need to fork the repository or branch off the develop
branch.
Make sure to follow the conventional commit specification when contributing.
Once you are finished with your changes, run npm test
to make sure all tests pass. Then, create a pull request against develop
, and a team member will review and merge your pull request.
Once the pull request is merged, an auto generated pull request will be created against master
to update the changelog and increase the versioning. After the auto-generated pull request has been merged to master
, the version will be bumped and published to npm.
5.15.1 (2019-09-10)
<a name="5.15.0"></a>
FAQs
Generator for Kitura REST webservice servers
The npm package generator-swiftserver receives a total of 20 weekly downloads. As such, generator-swiftserver popularity was classified as not popular.
We found that generator-swiftserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.