Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
/ lnotebook Public archive

Simple asynchronous notebook API that stores notes in PostrgreSQL database.

Notifications You must be signed in to change notification settings

neocim/lnotebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LNotebook

asynchronous API that will helps you to write simple notebook

Important

I don't recommend using this API in large projects because it is a too simple and inflexible API (one of the reasons is this is my first API).

This API using:

Preparing

Before start working with notebook you must complete commands below.

  1. Clone our repository:
git clone https://github.com/Nnenty/lnotebook
  1. Export your database (change URL on yours):
export DATABASE_URL=postgres://username:password@localhost/db`
  1. Migrate using command:
cd lnotebook/
sqlx migrate run

Note: install SQLx-cli if you don't have it installed to run code above.

Then you have a database ready to use in notebook.

Start the notebook

Clarification: all code in this section assumes that you have completed all commands from the section Preparing.

cd notebook_example/
  • Let's try execute cargo run only:
cargo run

Note: when you use cargo run without terminal command, program should display all total notes. Read more about terminal commands in our documentation.

Let's add new note:

cargo run -- add-note passwords

The program will ask you to enter the desired note to add to the notebook. Paste text login: krutoy_4el password: 1234#endnote# into.

Then let's print our note:

cargo run -- display-note passwords

The output of this program will be like this:

ID: 1
Name: passwords
Data:
login: krutoy_4el
password: 1234

More about terminal commands

To learn more about commands in terminal similar to add-note from the example above read our documentation.

Licenses

Licensed under either license:

  • Apache-2.0 License
  • MIT License

About

Simple asynchronous notebook API that stores notes in PostrgreSQL database.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages