Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

candyjs

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

candyjs

An Object-Oriented node mvc and REST framework

  • 4.20.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

An object-oriented efficient MVC and REST framework

NPM version Test coverage

CandyJs is a new framework and it is not based on the third party framework

Why CandyJs

  • CandyJs implements the MVC (Model-View-Controller) architectural pattern

  • Auto router system

  • CandyJs is extremely extensible

  • Practice with TypeScript

DOC

Version of Node.js

nodejs >= 10.0

Quick start

# install
npm install -g @candyjs/cli

# run the command
candyjs-cli

Hello world

CandyJs application start with an entry file

// the entry file index.ts
import '@candyjs/tswrapper';

import CandyJs from 'candyjs';
import App from 'candyjs/web/Application';

new CandyJs(new App({
    'id': 1,

    // define debug mode
    'debug': true,

    // define the base path of the running application
    'appPath': __dirname + '/app'

})).listen(2333, () => {
    console.log('listen on 2333');
});

Alias

  • @candy the directory where the Candy.ts file is located

  • @app the base path of the running application

  • @runtime the runtime path of the running application. Defaults to @app/runtime

Application structure example

|- index.ts
|
|- node_modules
|
|- public
|
|- app
|  |
|  |-- controllers
|      |
|      |-- user
|      |   |
|      |   |-- IndexController.ts
|      |   |-- OtherController.ts
|      |
|      |-- goods
|      |   |
|      |   |-- IndexController.ts
|      |   |-- OtherController.ts
|      |
|   -- views
|      |
|      |-- user
|      |   |
|      |   |-- index.html
|      |   |-- other.html
|      |
|   -- goods
|      |   |
|      |   |-- index.html
|      |   |-- other.html
|      |
|   -- modules
|      |
|      |-- actives
|      |   |
|      |   |-- controllers
|      |   |   |
|      |   |   |-- IndexController.ts
|      |   |
|      |   |-- views
|      |   |   |
|      |   |   |-- index.html
|      |   |
|      |
|   -- runtime
|

Keywords

FAQs

Package last updated on 19 Jun 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc