0.1.3 • Published 2 years ago

@dpapejs/serve v0.1.3

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

@dpapejs/serve

Description

🛠️ Express based tools for NodeJS development

Create the app

# Creating an app folder
mkdir [appName]
# Go to the app folder
cd [appName]
# Initialize the app
npm init -y

Install

npm i @dpapejs/serve -S
# OR
yarn add @dpapejs/serve -S

Creating a Configuration File

// dpa.serve.js
const { join } = require('path')
const { createApp } = require('@dpapejs/serve')
createApp({
  // Application main
  entry: 'index',
  // Service port
  servicePort: 5001,
  // Mysql configuration (optional)
  mysql: {
    user: 'root',
    password: 'root',
    database: '[db-name]'
  },
  // MongoDB configuration (optional)
  mongo: {
    user: 'admin',
    password: 'root',
    database: '[db-name]',
    authDatabase: 'admin'
  },
  // Static service configuration
  staticService: {
    path: '/',
    filename: 'static'
  },
  // Static resource directory name
  publicPath: 'static'
})