
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
cng-micro-service
Advanced tools
cd /my-projects
mkdir my-api-www-api-resful-test
cd my-api-www-api-resful-test
npm init -y
npm install cng-micro-service@latest cng-node-js-utils@latest node-js-orm@latest
npm install cng-micro-service@latest
npm i fs path mime-types
# delete ./package.json and run this command:
node ./node_modules/cng-micro-service/sync-libs/sync-test-libs.js
# install all libs for api
npm i
# run sample server
node ./server.js
# define in package.json for test
npm test
# or
# define in package.json for start
npm start
mkdir logs
mkdir cfg
cp ./cfg-sample ./cfg
npm node-js-orm
for define your model.
module.exports = {
// your subdirectory for access your service as https://<your domain resource server>/<basename>
// /<base-name>
BASE_NAME: "xxx",
// your service name with version
SERVICE_NAME: "xxx-1.0",
// your server for proxy token
AUTHENTICATION_SERVER_LINK: "https://<your-domain or ip:port>/sso"
}
./test/create-api-functions/0.README-create-api-function.md
./test/create-db
;./test/create-models
./test/migrate-database
node ./test/create-api-functions/create-routers-handlers/x-create-api-routers-handlers.js
./server-<your service name>.js
with following waterfall from server --> routes --> routers --> handlers
. You can test this server by:
node ./server-<your service name>.js
# server run in your port - and your designed functions_apis in excel file above
./handlers/<your-servies-version>/<your-sub-handler>.js
with all help by this sample. Only doing simple function in nodejs note more...http://localhost: for test apis
http://localhost:/ for your web server
// add libs
const path = require("path");
// add root
const ROOT_DIR = __dirname
.split(path.sep)
.slice(0, __dirname.split(path.sep).length - 0)
.join(path.sep);
const expressCfg = {
port: 8080 // your port
// ...
// root page when http(s)://<hostname:port>/ with index.html
, staticRoot: `${ROOT_DIR}/www-root`
// subdirectory when http(s)://<hostname:port>/<baseDirectory> with index.html
, staticHtml: `${ROOT_DIR}/client-ionic-react-sso/build`
// ...
};
FAQs
for nodejs create javascript source code auto
The npm package cng-micro-service receives a total of 0 weekly downloads. As such, cng-micro-service popularity was classified as not popular.
We found that cng-micro-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.