Skip to content

Commit

Permalink
Update readme serve mjs javascript modules
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoluciano committed Jun 4, 2024
1 parent cf3cc43 commit 8bd8667
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 16 deletions.
81 changes: 65 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

Web server directory index customization with preview, pagination, download — h5ai.

![SDI h5ai screenshot](https://repository-images.githubusercontent.com/806409657/7e051d9f-5900-4ff1-9b1c-d96cfd9bfbd6)

---

## SDI — h5ai

Unpack server directory index h5ai to your `/www/public/*.*`
Expand All @@ -16,13 +12,33 @@ and access your `https://example.com/public` or `http://localhost`
Whatever you drop on the Public folder will automatically
be available on the web server and you can easily share the links.

## Server Index redirection
### 1. Server AutoIndex

Enables or disables automatic directory listing for directories missing an index page.

Add the public directory index to your server configuration.
You can also redirect every access to the /public/ directory.
See how to redirect [Apache httpd, lighttpd, and nginx][wiki]
See how to redirect [Apache httpd, lighttpd, and nginx][wiki]

### 2. JavaScript Modules

Default server configuration does not serve <code>.mjs</code>
PDF.js requires this Mime Type in your server configuration,
otherwise you'll get a browser error :

> Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html"
See [Apache httpd, lighttpd, and nginx][wiki] to add <code>.mjs</code> JavaScript MIME type.

---

## SDI — CRUD
![SDI h5ai screenshot](screen.png)

---

## Development Note

### SDI — CRUD

[Branch local][wiki] to create, read, upload and delete
Authenticate using password-based Accounts.
Expand All @@ -33,25 +49,57 @@ Authenticate using password-based Accounts.
[project wiki][wiki].
* For bug reports and feature requests please use [issues][github-issues].

---

### Development

#### Build

There are installation ready packages for the latest [releases][release] and
[dev builds][develop]. But to build **h5ai** yourself either `git clone` or
download the repository. From within the root folder run the following
commands to find a fresh zipball in folder `build` (tested on linux only,
requires [`node 10.0+`][node] to be installed, might work on other
configurations).
[dev builds][develop].
But to build **h5ai** yourself either `git clone` or
download SDI—CRUD.

Change Node.js version with [Node Version Manager][nvm]
Install the proposed node version locally [`node 16.17.0`][node]
Cross-env tested on Linux and Windows,
might work on other configurations.

```sh
nvm install 16.17.0
```

List node versions

```sh
nvm ls
```

and in order to use it:

```sh
nvm use 16.17.0
```

From within the root folder of sdi-crud run the following commands

```sh
> npm install
> npm run build
```

#### Development cross env
Find a fresh zipball in folder `build`


#### Development cross-env

Linux

```sh
> npm run clean
> npm run reinstall
> npm run rebuild

```

Windows

```sh
> npm run clean-win
Expand Down Expand Up @@ -100,6 +148,7 @@ too. Exceptions are some [Material Design icons][material-design-icons] (CC BY 4
[release]: https://github.com/gigamaster/server-directory-index/releases
[develop]: https://github.com/gigamaster/server-directory-index
[node]: https://nodejs.org
[nvm]: https://github.com/nvm-sh/nvm
[material-design-icons]: https://github.com/google/material-design-icons

[license-img]: https://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square
Expand Down
Binary file added screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8bd8667

Please sign in to comment.