• I want to make some notes


    Hi, guys, long time to not update my blog in 博客园,Now, I'm studying in Denmark, and worked part-time in a start-up. Everything is fine now. For everyday I touch new things in my work and study, I want record them in my blogs, because they are so easy to be forgotten. Meanwhile, I think it is very hard to insist if I cost several hours to do this thing, I don't want to give up after several days:) So, I decide just to take about half a hour a day to do this meaningful thing. It's cooool.

    Ok, I will start and most piece of words would be in English in order to help myself practice my English.

    deployment, CI/CD

    Many start-ups put their code repositories in github or gitlab, and when them push a new version to gitlab, they need a quick and robust tool to deploy the code to production environment (like amazon cloud). So this whole process is called Continuous integration and Continuous deployment. Jenkins is a good tool to do this job and have both windows and linux version.

    use jest to mock a file object or file-upload process

    In my company, I need using jest to test the server (using apollo server and graphql), but it's really hard to mock the file stuff. I search in goole, tried a lot of solution, and still can't find one that works.The thing is that the server side doesn't consider it is a file.. So I ask my question in StackOverflow https://stackoverflow.com/questions/57506231/how-to-mock-file-upload-or-file-object-in-jest.

    user registration and send email

    When user want register, our system should send user's email address an email which contains a link for user to activate his account in our system. And we decide to put the a encoded string which contains the information of his email in the link. We do like this, because we don't want to create a user in our database before the user activates his account.

    dataSource in apollo-server

    the file in datasource folder should only communicate with DB, and in particular, components.js should only communicate the collection Components in MongoDb. So we should keep the other logic in resolver or in some services.

    debug in Jest

    when use Jest to test , debug is an annoying thing. The message in most situation doesn't show the real problem. When it shows a 400 error from server, it means that there is some wrong in your graphql structure.

    apollo server engine

    apollo server engine is a good online tool that help the developer statistics the visiting data and errors. With this tool, developer can easily know the running status of the website.

    Altair

    Altair is a good tool send request with file to apollo-server.

  • 相关阅读:
    查看windows以前连过的wifi密码
    winscp可能的替代品?
    查看windows的进程启动参数
    Ubuntu Server 安全补丁、版本升级
    AtCoder Beginner Contest 217 题解
    F. Alice and Recoloring 1&2
    E. Bored Bakry
    C. Bakry and Partitioning
    2021牛客多校 第四场
    AES解密报Given final block not properly padded
  • 原文地址:https://www.cnblogs.com/Andres/p/11360268.html
Copyright © 2020-2023  润新知