Try   HackMD

Database Connection

We use Sequelize for ORM. You could specify your database connection with all Sequelize options.

Basic usages:

You could simply use this connection string to specify basic information of the database:

mysql://john:qwerty@example.com:9821/hackmd_db // The string above follows this pattern: // <dialect>://<username>:<password>@<host>:<port>/<database>

This connection string can be passed to CodiMD using either config.json or environment variables:

Environment Variables config.json
CMD_DB_URL dbURL

Advanced usages:

If you want to specify advanced configs for your own database, you could use the db variable in config.json.

These configs should follow this pattern:

"db": { "username": "", "password": "", "database": "codimd", "host": "localhost", "port": "5432", "dialect": "postgres" },

For example, if you want to test your code with sqlite with in-memory storage:

"db": { "dialect": "sqlite", "storage": ":memory:" }

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Hint:

  • You could use any DBMS, such as: MariaDB, SQLite, or MSSQL, BUT we recommend only PostgreSQL or MySQL.
  • We will only support PostgreSQL and MySQL in future database migrations, if any.

We highly recommend to use UTF8 for database encoding, or you might find some url leads to not found, see more at https://github.com/hackmdio/codimd/issues/1392.

Take MySQL config as example:

[mysqld]
collation-server = utf8mb4_unicode_ci
init-connect='SET NAMES utf8mb4'
character-set-server = utf8mb4
tags: CodiMD Docs