Skip to content

Commit

Permalink
docs: expressjs reference
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon committed Jan 10, 2025
1 parent dc3b61b commit 6e68078
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
65 changes: 65 additions & 0 deletions docs/reference/extensions/expressjs-framework.rst
Original file line number Diff line number Diff line change
@@ -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 ``[email protected]``
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/<filename>`` 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:
``<rock name>``, ``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`
1 change: 1 addition & 0 deletions docs/reference/extensions/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ initiating a new rock.
.. toctree::
:maxdepth: 1

expressjs-framework
flask-framework
django-framework
fastapi-framework
Expand Down

0 comments on commit 6e68078

Please sign in to comment.