All Projects → nestjs → Serve Static

nestjs / Serve Static

Licence: mit
Serve static websites (SPA's) using Nest framework (node.js) 🥦

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Serve Static

Nestjs Example
NestJS example with GraphQL, Schema-Stitching, Dataloader, GraphQL Upload, RabbitMQ, Redis, Scalable Websocket and JWT authentication
Stars: ✭ 111 (-33.53%)
Mutual labels:  nestjs
Nest Emitter
Strongly 💪🏼 Typed Eventemitter Module For Nestjs Framework 🦁
Stars: ✭ 133 (-20.36%)
Mutual labels:  nestjs
Nestjs Flub
Pretty Error 😫 Stack Viewer for NestJS Framework 🛠️
Stars: ✭ 158 (-5.39%)
Mutual labels:  nestjs
Nest Permissions Seed
A simple application demonstrating the basic usage of permissions with NestJS.
Stars: ✭ 121 (-27.54%)
Mutual labels:  nestjs
Nest Event
Event handling with decorators for NestJS Framework
Stars: ✭ 128 (-23.35%)
Mutual labels:  nestjs
Throttler
A rate limiting module for NestJS to work with Fastify, Express, GQL, Websockets, and RPC 🧭
Stars: ✭ 145 (-13.17%)
Mutual labels:  nestjs
Nest
A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8) 🚀
Stars: ✭ 42,981 (+25637.13%)
Mutual labels:  nestjs
Wipi
nextjs + nestjs + TypeScript +MySQL 开发的前后端分离,服务端渲染的博客系统
Stars: ✭ 163 (-2.4%)
Mutual labels:  nestjs
Nestjs Rbac
Awesome RBAC for NestJs
Stars: ✭ 129 (-22.75%)
Mutual labels:  nestjs
Domain Driven Hexagon
Guide on Domain-Driven Design, software architecture, design patterns, best practices etc.
Stars: ✭ 4,417 (+2544.91%)
Mutual labels:  nestjs
Nestjs Amqp
Amqp connections for nestjs 💌
Stars: ✭ 123 (-26.35%)
Mutual labels:  nestjs
Nest Cnode
CNode 社区 Nest 版本 https://cnodejs.org/
Stars: ✭ 125 (-25.15%)
Mutual labels:  nestjs
Nest User Auth
A starter build for a back end which implements managing users with MongoDB, Mongoose, NestJS, Passport-JWT, and GraphQL.
Stars: ✭ 145 (-13.17%)
Mutual labels:  nestjs
Base App Nestjs
Base application using nest JS focused on DDD architecture and SOLID principles
Stars: ✭ 115 (-31.14%)
Mutual labels:  nestjs
Pizza Sync
Pizza-Sync is a web app built on the frontend with angular, ngrx and on the backend with Nest. It let you and your friends/colleagues choose a pizza before placing a group order. Built using https://github.com/maxime1992/angular-ngrx-starter
Stars: ✭ 158 (-5.39%)
Mutual labels:  nestjs
Automapper
An Object-Object AutoMapper module for NestJS.
Stars: ✭ 110 (-34.13%)
Mutual labels:  nestjs
Schedule
Schedule module for Nest framework (node.js) ⏰
Stars: ✭ 137 (-17.96%)
Mutual labels:  nestjs
Nestjs Mongoose Crud
Nest.js crud module for mongoose models without `nestjsx/crud`
Stars: ✭ 164 (-1.8%)
Mutual labels:  nestjs
Config
Configuration module for Nest framework (node.js) 🍓
Stars: ✭ 161 (-3.59%)
Mutual labels:  nestjs
Serverless Core
Serverless Core module for Nest framework (node.js) 🦊
Stars: ✭ 154 (-7.78%)
Mutual labels:  nestjs

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads Travis Linux Coverage Discord Backers on Open Collective Sponsors on Open Collective

Description

@nestjs/serve-static package for Nest, useful to serve static content like Single Page Applications (SPA). However, if you are building MVC application or want to serve assets files (images, docs), use the useStaticAssets() method (read more here) instead.

Installation

$ npm i --save @nestjs/serve-static

Example

See full example here.

Usage

Simply import ServeStaticModule in your Nest application.

import { Module } from '@nestjs/common';
import { join } from 'path';
import { ServeStaticModule } from '@nestjs/serve-static';

@Module({
  imports: [
    ServeStaticModule.forRoot({
      rootPath: join(__dirname, '..', 'client')
    })
  ]
})
export class ApplicationModule {}

API Spec

The forRoot() method takes an options object with a few useful properties.

Property Type Description
rootPath string Static files root directory. Default: "client"
serveRoot string Root path under which static app will be served. Default: ""
renderPath string / RegExp Path to render static app (concatenated with the serveRoot value). Default: * (wildcard - all paths)
exclude string[] Paths to exclude when serving the static app. WARNING! Not supported by fastify. If you use fastify, you can exclude routes using regexp (set the renderPath to a regular expression) instead.
serveStaticOptions Object Serve static options (static files)

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].