Skip to content

DumiJDev/njinx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Njinx: The Lightweight, Mighty Nginx Manager for Java ⚡💪

Version: 0.1.0  
GroupId: `io.github.dumijdev`  
ArtifactId: `njinx`  
Java Version: 11 (because we like keeping things modern)  
License: MIT (open source, baby!)

Wait, What’s Njinx? 🤔

Good question! Njinx is a lightweight but powerful Java library designed to make managing your Nginx web server a breeze. It's got all the tools you need to parse, modify, and command your nginx.conf, all in Java. And yes, the "J" in Njinx is because Java deserves to be part of the fun! 😎

Why Should You Care? 🎉

Because Nginx management doesn’t have to be a pain! With Njinx, you can:

  • Parse and edit your nginx.conf file like a pro (with Java objects!).
  • Easily start, stop, and restart Nginx right from your Java app (because why open a terminal?).
  • Validate your configuration before launching, so no more config errors when you’re deploying under pressure. 😬

Best Part? It’s small but mighty—a true lightweight Nginx manager for Java! 🚀

How to Get Njinx 🛠️

Adding Njinx to your project is as simple as copy-pasting the following into your Maven pom.xml:

<dependency>
    <groupId>io.github.dumijdev</groupId>
    <artifactId>njinx</artifactId>
    <version>0.1.0</version>
</dependency>

Now, buckle up! Let’s take Njinx for a spin! 🎢


Let’s Talk Features! 💡

1. Parsing Your nginx.conf 📜

Reading your Nginx config in Java? No sweat. Njinx lets you transform your nginx.conf into a friendly, easy-to-use Java object.

// Step 1: Create the Njinx parser
NjinxConfigParser parser = new NjinxConfigParser();

// Step 2: Load your config from a string or file
NginxConfig config = parser.read(nginxConf);

// Step 3: Admire how neat it looks as a Java object
System.out.println(config);

Now you can tinker, modify, and explore your Nginx config with Java code! 💻

2. Writing Nginx Config Files ✍️

Manually editing nginx.conf? Ain’t nobody got time for that! Njinx lets you build your Nginx config from scratch, like you're playing with Lego blocks.

// Step 1: Create the NginxConfig object
NginxConfig config = new NginxConfig();

// Step 2: Add some basic parameters (like a boss)
config.add(new SimpleParam("user", "nobody")); 
config.add(new SimpleParam("worker_processes", "1"));

// Step 3: Add some HTTP magic
Http http = new Http();
http.add(new Server()
            .add(new SimpleParam("listen", "8080"))
            .add(new Location("/")
                .add(new SimpleParam("root", "html"))));
config.add(http);

// Step 4: Save it to a file (because you're awesome)
parser.write(config, new File("/path/to/nginx.conf"));

With just a few lines of Java, your Nginx config is ready to go! ⚙️

3. Managing Nginx from Java 🎛️

Tired of jumping between your app and the terminal? With Njinx, you can control Nginx directly from your Java app:

// Step 1: Create an Nginx manager and point it to your Nginx executable
NginxManager manager = new NginxManager("/path/to/nginx");

// Step 2: Start Nginx asynchronously (so you can multitask)
manager.startAsync();

// Step 3: Stop it when you’re done (because you’re the boss)
manager.stop();

No more juggling between command lines and your Java code! 🎯


Lightweight. Powerful. Java-Nginx Awesomeness. 💥

Njinx isn’t just another library—it’s a tiny powerhouse that makes managing Nginx as fun as a Java coding session should be. Whether you’re parsing configs or running Nginx commands, Njinx has your back. And did we mention it's light? Think of it like the ninja of Nginx management tools. 🥷


Want to Contribute? 👏

We love collaboration! Have an idea, a bug fix, or just want to add some flair to the project? Jump right in!

  1. Fork the project.
  2. Create a branch (bonus points for a clever name).
  3. Submit a pull request—and we’ll take it from there! 🧑‍💻

Need Help? Have Questions? 💬

We’re here to help! If you have any questions, feature requests, or just want to chat, feel free to reach out:

Email: [email protected]


That’s Njinx—lightweight, powerful, and Java-friendly Nginx management. Now go ahead and give it a try. Your Nginx server will thank you! 🎉

About

A library to manage nginx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages