1.2.25 • Published 9 months ago

molly-js v1.2.25

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Molly-js

Molly-js is a web server framework for Node.js that allows developers to quickly and easily create web applications. With an API similar to the popular Express.js library, Molly-js makes it easy to create HTTP and HTTPS servers, and its well-designed architecture optimized for video streaming provides a smooth experience for users.

In addition, Molly-js offers the ability to create multiple instances of the server in multiple threads, making it ideal for high-load applications. Based on the MVC design pattern, this framework encourages an organized and scalable structure for your web applications. It also comes integrated with a static site generator, making it easier to create static content for your applications.

With Molly-js, developers can focus on creating high-quality web applications without worrying about the complexity of the underlying infrastructure. Join the Molly-js development community and start creating impressive web applications with ease.

Key Features

  • API similar to Express.js
  • Based on the MVC design pattern
  • Optimized for video streaming
  • Integrated with a static site generator
  • Ability to create multiple instances of the server in multiple threads

Installation

To install Molly-js in your project, simply run the following command in your terminal:

npm install molly-js 

Usage

To start using Molly-js in your project, you first need to require it in your entry file:

const molly = require('molly-js');

From there, you need to define the routes of the controllers, the path to the static files and the number of instances or threads of the server:

molly.createHTTPServer({
  controller: path.join(__dirname,'testServer','Controller'),//Controller Components Paths
  viewer: path.join(__dirname,'testServer','Viewer'),        //Viewer Components Paths
  thread: 1                                                  //Number of instances
});

Then, to create a new controller, simply create a new .js file inside the controller folder and define the behavior of the controller:

module.exports = (req,res)=>{
    res.send(req.params,200);   
}

To create a page with static generation, you simply have to use the /°°/ tags to generate code or the <°°> tag:

  • Here's an example of how to generate a page using the /°°/ tag:
<body>
    /°(()=>{
        const result = new Array();
        for( var i=100; i--; ){
            result.push(`
                <a style="background: #222; color: white" > hello world ${i} </a> <br>
            `);
        } return result.join('');
    })()°/    
</body>
  • Here's an example of how to generate a page using the <°°> tag:
<body>
    <°PATH/TO/A/HTML_MODULE°>
</body>

Example

Here's a simple example using Molly-js.

Contribution

We welcome contributions! If you'd like to help improve Molly-js, please submit a pull request or open an issue on our GitHub repository.

License

Molly-js is available under the MIT License. See the LICENSE.md file for more information.

1.2.24

11 months ago

1.2.25

9 months ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.10

1 year ago

1.2.11

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.14

1 year ago

1.2.9

1 year ago

1.2.18

1 year ago

1.2.19

1 year ago

1.2.20

1 year ago

1.2.21

1 year ago

1.2.22

1 year ago

1.2.0

1 year ago

1.1.28

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.30

1 year ago

1.1.34

1 year ago

1.1.32

1 year ago

1.0.73

2 years ago

1.0.76

2 years ago

1.0.75

2 years ago

1.0.74

2 years ago

1.1.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.4

1 year ago

1.1.2

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.13

1 year ago

1.0.80

2 years ago

1.0.84

2 years ago

1.0.83

2 years ago

1.0.82

2 years ago

1.0.88

2 years ago

1.0.87

2 years ago

1.0.86

2 years ago

1.0.85

2 years ago

1.0.91

2 years ago

1.0.90

2 years ago

1.0.95

2 years ago

1.0.94

2 years ago

1.0.93

2 years ago

1.0.92

2 years ago

1.0.98

1 year ago

1.0.96

1 year ago

1.0.62

2 years ago

1.0.61

2 years ago

1.0.60

2 years ago

1.0.66

2 years ago

1.0.65

2 years ago

1.0.64

2 years ago

1.0.63

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.72

2 years ago

1.0.71

2 years ago

1.0.70

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.40

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.49

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.55

2 years ago

1.0.54

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.58

2 years ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago