This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

nova-framework
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Nova Framework

Status GitHub Issues GitHub Pull Requests License


📝 Table of Contents

🧐 About

Nova is a framework that is intended to help setup and maintain servers and integrations with ease. It allows you to setup and configure Graphql, Kafka, Redis, GRPC, Knex, and SocketIO and easily have access to them accross your application without installing any additional dependencies. Custom integrations of any other packages are super simple to do.

🏁 Getting Started

These instructions will get the project up and running on your local machine for development and testing purposes.

Prerequisites

Installing

npm i nova

End with an example of getting some data out of the system or using it for a little demo.

🎈 Usage

Creating a basic HTTP server:

import { Nova, LocalStorage } from "nova";

const novaServer = new Nova({
  rootDir: __dirname, // root source directory
  storage: new LocalStorage(),
  services: [
      // add services here...
  ],
});

novaServer.listen().then(() => {
  console.log("Server Started!");
});

Adding and configuring services :

import { Nova, Graphql, WebSocket } from "nova";

const novaServer = new Nova({
  services: [
    new WebSocket(),
    new Graphql({
      typeDefs: `
        type Query {
          hello: String
        }
      `,
      playground: true,
      resolvers: {
        Query: {
          hello: () => {
            return "hello";
          },
        },
      },
    }),
  ],
});

Creating HTTP controllers:

import { Controller } from "nova";

class Users extends Controller {
  constructor() {
    super();
    this.endpoint = "/users";
    this.router.get("/", this.home);
  }
  home(req: any, res: any) {
    res.send("Hello");
  }
}

Creating Custom Service:

import { Service } from "nova";

class CustomService extends Service {
  constructor(config) {
    super();
    // configure service...
  }
  beforeStart(app: Express, server: Server) {
    // Before server starts...
  }
  afterStart(app: Express, server: Server) {
    // After server starts...
  }
}

⛏️ Built Using

✍️ Authors

See also the list of contributors who participated in this project.

Readme

Keywords

none

Package Sidebar

Install

npm i nova-framework

Weekly Downloads

3

Version

1.0.0

License

ISC

Unpacked Size

49.4 kB

Total Files

40

Last publish

Collaborators

  • michael616kriel