From 6e68078a3cd0d5bb90a8d77bd63908bb5e331b30 Mon Sep 17 00:00:00 2001 From: Yanks Yoon Date: Fri, 10 Jan 2025 04:35:43 +0000 Subject: [PATCH] docs: expressjs reference --- .../extensions/expressjs-framework.rst | 65 +++++++++++++++++++ docs/reference/extensions/index.rst | 1 + 2 files changed, 66 insertions(+) create mode 100644 docs/reference/extensions/expressjs-framework.rst diff --git a/docs/reference/extensions/expressjs-framework.rst b/docs/reference/extensions/expressjs-framework.rst new file mode 100644 index 000000000..3c403a69d --- /dev/null +++ b/docs/reference/extensions/expressjs-framework.rst @@ -0,0 +1,65 @@ +.. _expressjs-framework-reference: + +expressjs-framework +------------------- + +The ExpressJS extension streamlines the process of building ExpressJS application +rocks. + +It facilitates the installation of ExpressJS application dependencies, including +Node and NPM, inside the rock. Additionally, it transfers your project files to +``/app`` within the rock. + +.. note:: + The ExpressJS extension is compatible with the ``bare`` and ``ubuntu@24.04`` + bases. + +Project requirements +==================== + +There is 1 requirement to be able to use the ``expressjs-framework`` extension: + +1. There must be a ``package.json`` file in the ``app`` directory of the project + with ``start`` script defined. + +``parts`` > ``expressjs-framework/dependencies:`` > ``stage-packages`` +====================================================================== + +You can use this key to specify any dependencies required for your ExpressJS +application. In the following example we use it to specify ``libpq-dev``: + +.. code-block:: yaml + + parts: + expressjs-framework/dependencies: + stage-packages: + # list required packages or slices for your ExpressJS application below. + - libpq-dev + + +``parts`` > ``expressjs-framework/install-app`` > ``prime`` +=========================================================== + +You can use this field to specify the files to be included or excluded from +your rock upon ``rockcraft pack``. Follow the ``app/`` notation. For +example: + +.. code-block:: yaml + + parts: + expressjs-framework/install-app: + prime: + - app/.env + - app/script.js + - app/templates + - app/static + +Some files/directories, if they exist, are included by default. These include: +````, ``app.js``, ``migrate``, ``migrate.sh``, ``migrate.py``, +``bin``, ``public``, ``routes``, ``views``, ``package.json``, +``package-lock.json``. + +Useful links +============ + +- :ref:`build-a-rock-for-an-expressjs-application` diff --git a/docs/reference/extensions/index.rst b/docs/reference/extensions/index.rst index 3bf8ae6c6..74f405d56 100644 --- a/docs/reference/extensions/index.rst +++ b/docs/reference/extensions/index.rst @@ -11,6 +11,7 @@ initiating a new rock. .. toctree:: :maxdepth: 1 + expressjs-framework flask-framework django-framework fastapi-framework