npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

directus-extension-serve

v0.0.1

Published

Serve files or an app with directus by using filename or file paths.

Readme

Directus Extension Serve

Serve files or an app with directus by using filename or file paths.

Install

Search for "serve" in the Marketplace of your app settings, navigate to the extension page, and click "Install Extension"

Goto your Directus URL with the path /serve like this http://localhost:8055/serve. You should see the response "Content not found".

Configure serve folder

Goto your /admin/files like http://localhost:8055/admin/files and create a new folder. Copy the generated folder id: folder id

Next goto /admin/settings/policies like http://localhost:8055/admin/settings/policies and click on the Public policy. Scroll to Permissions and click on Add Collection and search for directus_files. Select the directus_files and click on Read tag and select Use Custom. Click on Add filter, search for folder and select it. Use equals or is one of and paste your generated folder id into the field. add policy for id.gif

NOTE: Every file inside your created folder will be publicly available. Make sure you don't leak any sensitive documents.

Test your serve folder

Goto your /admin/files like http://localhost:8055/admin/files and open the generated folder. Upload a file like test.txt with some content. Goto your Directus URL with the path /serve/test.txt like this http://localhost:8055/serve/test.txt. You should see the content of your file.

Deploy a Website or App

You can upload a index.html file to serve a static website under your /serve path. All static assets will be served from the same directus folder. By default, the serve extension will fetch the first file with the path name you provide.

For example, if you upload a file with the name index.css, it wouldn't matter if your index.html references index.css or /assets/index.css. It will just check the file name.

To change this behavior, you can use the location property in the directus_files collection, to specify different paths for your files, if they have the same name.

Check out the Configuration section below for more details.

Deploy a Single Page Application (SPA)

You can deploy a Single Page Application (SPA) like React, Vue, or Angular with this serve extension. We recommend to use the directus-serve-cli to upload your dist or build folder.

You can use the upload command to upload your files to the Directus instance.

npx directus-serve-cli upload --directusUrl http://localhost:8055 --src ./dist --uploadFolder <your-folder-id> --directusToken <your-access-token>

NOTE: Make sure to replace <your-folder-id> with the folder id you created in the previous step and <your-access-token> with a Directus access token for a user with the permission to upload files. For more details, check out the directus-serve-cli.

Configuration

// TODO: Add configuration section