Git Product home page Git Product logo

hydrogen's People

Contributors

akira-cn avatar angusfu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hydrogen's Issues

Questions about file downloads

  • windows10
  • Hydrogen:latest

Through aircode's upload API, files can be uploaded, but there will be problems with downloading, prompting no such file.
image
The results are as follows

import aircode from 'aircode';

export default async function (params, content) {
    // Get the file from multipart/form-data params, `myFile` is the key
    const { _id } = params;

    // You can do some permission checks before uploading
    // ...
    
    // Upload the file to AirCode
    const res = await aircode.files.download({
        // Replace the _id value with your file's
        _id
    });
    // return the URL of file
    return {
        res,
    };
}

image

2023-10-19 Additional information

I still think there is something wrong with using the airecode api for file upload and download in Hydrogen.

If you do not change the data when uploading and saving, only modify the download method as follows
https://github.com/AirCodeLabs/Hydrogen/blob/34d9a016cd7461d4f12ec053399846ad4b925437/src/runtime/file-service.js#L103C7-L103C76

filepath = path.resolve(process.env.AC_FAAS_ROOT, filepath.slice(1));

filepath = process.env.AC_FAAS_ROOT + filepath.slice(2)

关于数据库相关的问题

这个项目是必须依赖aircode云平台吗还是它是一个类似airecode云平台的开源?

数据库这块按照airecode文档执行的话

import aircode from 'aircode';

export default async function (params, context) {
  const dbs = aircode.db.table('persons');
  // Use `save` to add a new record
  const result = await dbs.save({
    name: 'Micheal',
    age: 28,
  });
  // const result = await dbs.where({ name: 'Micheal' }).find();

  return {
    result
  };
};

以上在hydroge中运行是访问api是没有任何信息的,数据是能正常在本地插入(如下图)
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.