Skip to content

xpresserjs/express-server-module-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XpresserJs Express Server Module provider

This module provides an express server for XpresserJs.

If you are conversant with the common js version of XpresserJs, this module is the equivalent of that with a few yet to arrive features.

import { init, __dirname } from "@xpresser/framework";
import ExpressProvider from "@xpresser/express-module";

// Get Base Folder Path
const base = __dirname(import.meta.url);

// Init Xpresser
const $ = await init({
  env: "development",
  name: "Express Provider",
  paths: { base }
});

// Register Server Module with Express Provider
const { router } = await ExpressProvider.use($);

router.get("/", (http) => {
  return http.send("Hello World!");
});

// Start Xpresser
$.start().catch($.console.logErrorAndExit);

About

ExpressJs Server Module Provider

Resources

Stars

Watchers

Forks

Packages

No packages published