Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LoopBack storage postgres component provides Node.js and REST APIs to manage binary contents using Postgres Large Object

NotificationsYou must be signed in to change notification settings

sfellahi/sfellahi-loopback-component-storage-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusDependency Statuscodecov.io

LoopBack storage postgres component provides Node.js and REST APIs to manage binary contents using Postgres Large Object

Installation

Install the storage component as usual for a Node package:

  npm install --save loopback-component-storage-postgres

Using it

Create a table to store file descriptions

  CREATE TABLE"my-table-to-store-files" (    idSERIALPRIMARY KEY,    containerTEXTNOT NULL,    filenameTEXTNOT NULL,    mimetypeTEXT,    objectidINTEGER UNIQUENOT NULL  );

Edit you datasources.json and add the following part

"pg_file":{"name":"pg_file","connector":"loopback-component-storage-postgres","host":"localhost","port":5432,"database":"test","table":"my-table-to-store-files","username":"test-user","password":"test-password"}

And the you can use it as a datasource of your model.

API

DescriptionContainer model methodREST URI
List all containersgetContainers(callback)GET /api/<model>
Get information about specified containergetContainer(container, callback)GET /api/<model>/:container
Create a new containercreateContainer(options, callback)PORT /api/<model>
Delete specified containerdestroyContainer(options, callback)DELETE /api/<model>/:container
List all files within specified containergetFiles(container, callback)GET /api/<model>/:container/files
Get information for specified file within specified containergetFile(container, file, callback)GET /api/<model>/:container/files/:file
Delete a file within a given container by nameremoveFile(container, file, callback)DELETE /api/<model>/:container/files/:file
Upload one or more files into the specified containerupload(container, req, res, callback)POST /api/<model>/:container/upload
Download a file within specified containerdownload(container, file, res, callback)GET /api/<model>/:container/download/:file

About

LoopBack storage postgres component provides Node.js and REST APIs to manage binary contents using Postgres Large Object

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp