Skip to content

rootDeibis/express-subdomain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-subdomain

A script that allows using subdomains in express.js

Example

import subdomain from "express-subdomains-middleware";
import express from 'express';

const app = express();


const FrontEndRouter = subdomain("www",app);
const BackEndRouter = subdomain("api", app);


FrontEndRouter.static("./static");

BackEndRouter.get("/example", (req, res) => {
    res.json({
        text: 'This is a backend path'
    })
})

app.listen(3000);

About

A script that allows using subdomains in express.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published