Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a file using the api #1933

Open
nezlicodes opened this issue Feb 27, 2023 · 4 comments
Open

Create a file using the api #1933

nezlicodes opened this issue Feb 27, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@nezlicodes
Copy link

I'm working on a project where I need to create files programatically. Is there a way to achieve something like the code below ?

import { create } from '@nuxt/content'

const newPost = await create('products', {
  title: 'New blog post',
  date: new Date(),
  body: '# Hello, world!'
})


newPost()
@nezlicodes nezlicodes added the enhancement New feature or request label Feb 27, 2023
Copy link
Member

atinux commented Feb 27, 2023

Is it for development or for production as well?

@nezlicodes
Copy link
Author

dev and prod as well.

Copy link
Member

atinux commented Feb 27, 2023

Prod is hard since it is cached and the files are directly linked to the filesystem.

We do have https://nuxt.studio that will let you live-edit Nuxt Content websites in production I don't know if you saw it?

@LoganTann
Copy link

Related to this issue : #783

We do have https://nuxt.studio/ that will let you live-edit Nuxt Content websites in production I don't know if you saw it?

I saw it, but will this solve the problem ? It seems like nuxt studio is a cloud based solution. Also, i would like to host my files only in the filesystem, and not committing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants