1.2.25 • Published 2 years ago

molly-js v1.2.25

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.2.25

2 years ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.2.16

2 years ago

1.2.17

2 years ago

1.2.14

2 years ago

1.2.9

2 years ago

1.2.18

2 years ago

1.2.19

2 years ago

1.2.20

2 years ago

1.2.21

2 years ago

1.2.22

2 years ago

1.2.0

3 years ago

1.1.28

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.30

3 years ago

1.1.34

3 years ago

1.1.32

3 years ago

1.0.73

3 years ago

1.0.76

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.1.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.4

3 years ago

1.1.2

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.13

3 years ago

1.0.80

3 years ago

1.0.84

3 years ago

1.0.83

3 years ago

1.0.82

3 years ago

1.0.88

3 years ago

1.0.87

3 years ago

1.0.86

3 years ago

1.0.85

3 years ago

1.0.91

3 years ago

1.0.90

3 years ago

1.0.95

3 years ago

1.0.94

3 years ago

1.0.93

3 years ago

1.0.92

3 years ago

1.0.98

3 years ago

1.0.96

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.66

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.70

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.40

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.45

3 years ago

1.0.49

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.55

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago